Searcharxiv⌕ Search

arXiv subjects

Abhishek Rai

Publications and source records attributed to Abhishek Rai.

7 recordsLinked to original sources

Beyond Plain MCP: Do Decision Models and Code Mode Make Tool Use Cheaper and Faster?

Model Context Protocol (MCP) gateways manage tool catalogs for language model agents using two primary paradigms: code mode where agents write scripts against tool stubs and decision layers which are cheap routers that preselect tool subsets. Using a controlled harness across 12 servers, up to 1,958 distractor tools, and three open-weight agents including Qwen, Gemma, and Nemotron, we present a preregistered evaluation on a sealed test split to determine when each approach succeeds. Code mode substantially outperforms plain MCP, cutting token usage by 70 to 90 percent while significantly boosting utility. Declaring return-shape hints in code mode stubs is a first-order variable, swinging success by up to 39.5 points for lower-performing agents, an effect larger than adding a router. The central hypothesis that a decision layer in front of code mode beats code mode alone is not confirmed, showing minor, statistically non-significant improvements for weaker agents and a slight cost for the strongest. We publicly release our harness, a finetuned 4B tool selection model, and all evaluation traces to support robust community experimentation on local AI privacy and agent architectures.

cs.SE↗

Context-Aware Prompt Injection Detection via Small Language Models in RAG Pipelines: nokast-secureRAG

Local Retrieval-Augmented Generation (RAG) systems are vulnerable to indirect prompt injection and retrieval poisoning, where malicious instructions in retrieved content are mistaken for trusted input. We present nokast-secureRAG, a roughly 0.5B-parameter small language model that acts as a semantic firewall between retrieval and generation. It jointly evaluates the user query and retrieved context, classifying the pair as safe, suspicious, or malicious. The model is trained using a teacher-judge-student pipeline: a 35B teacher generates 5,233 examples across four attack families, and an independent 120B judge re-labels them, achieving 95.0% agreement before student fine-tuning. On a held-out in-distribution test set, the model achieves 0.994 detection recall at a 0.026 false-positive rate and a 0.006 attack-success-rate proxy, outperforming a regex baseline, a public prompt-injection classifier, Llama Guard 3 1B, and its untuned version. Prompt-Guard-86M reaches 0.900 recall but has a 0.690 false-positive rate. On a judgment-flip test, where the same sentence is benign or malicious depending on context, the model correctly classifies both cases 75% of the time, outperforming the compared baselines. Ablations indicate that retrieved context carries the main attack signal, while query-context consistency reduces false positives. Single-request latency is 293-404 ms, above the target of 100 ms, while amortized throughput latency is 37 ms under batching. On the external PoisonedRAG benchmark, recall falls to near zero, indicating that fluent fact-poisoning attacks lie outside the detector's instruction-consistency threat model. We report this limitation alongside the in-distribution results. The model, data-generation pipeline, and evaluation harness are released open source.

cs.CR↗

Numerical Simulation of Thermal Energy Storage using Phase Change Material

This paper presents a study on the design optimization of Thermal Energy Storage (TES) using a cylindrical cavity and Gallium as a Phase Change Material (PCM). The objective is to improve the time span of charging and discharging, as well as minimize heat loss during storage. Five different models with varying geometries and heat source configurations were designed and analyzed using CFD simulation in ANSYS Fluent. The results indicate that models with fins on the heat source surface outperform those without fins, due to increased heat transfer surface area. Comparing the models, Model 4 with three heat sources performs similarly to Model 2 with four heat sources, suggesting an optimal design. However, Model 5 demonstrates less desirable results as the charging time of the PCM increases. Overall, this study highlights the effectiveness of the optimized design in Model 4 with three heat sources for efficient Thermal Energy Storage.

physics.flu-dyn↗

Modification of electronic structure and morphology of Ni2MnGa(100) by Cr adlayers

The growth of Cr adlayers on the Mn-Ga terminated surface of Ni2MnGa(100) has been studied in this work. We show formation of islands of epitaxial Cr layer up to 4 atomic layer heights using scanning tunneling microscopy, while core-level x-ray photoelectron spectroscopy (XPS) indicates absence of any intermixing of the adlayer and the substrate. The density of states (DOS) of the thin Cr layer (2.7 ML) measured by scanning tunneling spectroscopy exhibits nice agreement with density functional theory (DFT) that establishes that it is ferromagnetic. In contrast, a thick layer of Cr that also grows epitaxially on Ni2MnGa(100) is shown to be antiferromagnetic by comparing its XPS valence band with the DOS for bulk Cr calculated by DFT.

cond-mat.mtrl-sci↗

Scanning tunneling microscopy study of Ni2MnGa(100) surface

Ni2MnGa(100) surface has been investigated in the premartensite and martensite phase by using scanning tunneling microscopy. The presence of twined morphology is observed in the premartensite phase for Mn excess surface which exhibit non-equispaced parallel bands in one side of the twin boundary. Moreover, in the flat region of the surface two domains of non-periodic parallel bands corresponding to the incommensurate CDW is observed. Although, stoichiometric surface also exhibit twining but the parallel bands are equispaced and have equal corrugation. Most interestingly, coexistence of twined morphology and the CDW pattern is observed in the premartensite phase for Ni excess surface which was not reported till date. In the martensite phase for Mn excess surface, incommensurate CDW is transformed to commensurate CDW corresponding to the equispaced parallel bands. In stark contrast, stoichiometric surface exhibit parallel bands that have different periodicity in different regions. Both the voltage dependent STM and STS measurement establishes that this morphology is also related to the CDW.

cond-mat.mtrl-sci↗

Quasiperiodic ordering in thick Sn layer on $i$-Al-Pd-Mn: A possible quasicrystalline clathrate

Realization of an elemental solid-state quasicrystal has remained a distant dream so far in spite of extensive work in this direction for almost two decades. Here, we report the discovery of quasiperiodic ordering in a thick layer of elemental Sn grown on icosahedral ($i$)-Al-Pd-Mn. The STM images and the LEED patterns of the Sn layer show specific structural signatures that portray quasiperiodicity but are distinct from the substrate. Photoemission spectroscopy reveals the existence of the pseudogap around the Fermi energy up to the maximal Sn thickness. The structure of the Sn layer is modeled as a novel form of quasicrystalline clathrate on the basis of the following: Firstly, from ab-initio theory, the energy of bulk Sn clathrate quasicrystal is lower than the high temperature metallic $β$-Sn phase, but higher than the low temperature $α$-Sn phase. A comparative study of the free slab energetics shows that surface energy favors clathrate over $α$-Sn up to about 4 nm layer thickness, and matches $β$-Sn for narrow window of slab thickness of 2-3 nm. Secondly, the bulk clathrate exhibits gap opening near Fermi energy, while the free slab form exhibits a pronouced pseudogap, which explains the pseudogap observed in photoemission. Thirdly, the STM images exhibit good agreement with clathrate model. We establish the adlayer-substrate compatibility based on very similar (within 1%) the cage-cage separation in the Sn clathrate and the pseudo-Mackay cluster-cluster separation on the $i$-Al-Pd-Mn surface. Furthermore, the nucleation centers of the Sn adlayer on the substrate are identified and these are shown to be a valid part of the Sn clathrate structure. Thus, based on both experiment and theory, we propose that 4 nm thick Sn adlayer deposited on 5-fold surface of $i$-Al-Pd-Mn substrate is in fact a metastable realization of elemental, clathrate family quasicrystal.

cond-mat.other↗

Dirac cone in a non-honeycomb surface alloy

We demonstrate unexpected occurrence of linear bands resembling Dirac cone at the zone-center of Au$_2$Sn surface alloy with $\left( \begin{smallmatrix} 2&1\\ 1&3 \end{smallmatrix} \right)$ surface structure formed by deposition of about 0.9 ML Sn on Au(111) at elevated temperature. The surface exhibits an oblique symmetry with unequal lattice constants making it the first two dimensional surface alloy to exhibit Dirac cone with a non-honeycomb lattice.

cond-mat.mtrl-sci↗