Searcharxiv⌕ Search

arXiv subjects

Weixi Zhang

Publications and source records attributed to Weixi Zhang.

At least 19 recordsLinked to original sources

Context Has a Price: Adding and Removing Context for LLM Coding Agents under Prefix Caching

Coding agents repeatedly send their conversation history to a language model. Adding useful code may reduce search, while removing old tool outputs may shorten later prompts. But do these changes reduce the cost of solving a task? We study this as a measurement problem in more than 20,000 runs of open models on SWE-bench Verified, SWE-bench and Loc-Bench. We account separately for uncached input, cached input and output tokens. Three findings emerge. First, in our main evidence-package experiments, retrieved code reduces read and search commands by 18--34%, but increases cost by 33--42% when cached input costs one tenth of uncached input, without a measurable improvement in resolution. Second, removing old observations can either save money or increase cost: the same approach saves 19--36% without a cache discount but increases cost by 38--116% with a tenth-price cache. Third, shorter prompts do not guarantee cheaper runs because agents may respond by taking more steps. We also find that concurrent experiments can share cached prefixes and distort cost comparisons. These results show why context-management methods should be evaluated using both token prices and the agent's subsequent behavior.

cs.AI↗

Done, But Still Working: Anytime Evaluation of When Coding Agents Should Stop

Coding agents often continue working after their own tests pass. Does this additional work improve the patch, and how much could be saved by stopping earlier? We study these questions through anytime evaluation: replaying recorded runs, scoring intermediate patches with hidden tests, and measuring the cost incurred at each step. For policies that only stop a run or select an earlier patch, this allows paired comparisons without generating new trajectories, provided replay preserves the relevant states. Across about 6,000 runs of eight open models in two scaffolds on SWE-bench Verified, we find substantial differences in the value of continued work. The hindsight saving available at passing self-tests ranges from under 1% to 57%, depending on the model and scaffold. A rule that stops after the same patch passes twice saves 23% in a preregistered replication, but the preregistered quality test does not establish non-inferiority. We explain these differences by measuring how often a rule fires, how often the patch changes afterwards, and whether those changes repair or break it. Fine-tuning agents to imitate the rule saves 30% over six seeds, while quality preservation remains uncertain. Our results help identify both the opportunities and the risks of early stopping.

cs.AI↗

Correct Answers from Insufficient Histories: A Controlled Study of Agent Memory Evaluation

An answer can match the reference for a complete agent history even when the reader's visible history does not determine it. We study this distinction using executable device logs. Our protocol separates reference agreement, certified evidence sufficiency, and context-appropriate behavior. Insufficiency requires two legal histories yielding byte-identical visible contexts but different answers; public chronology and query cutoffs certify sufficient prefixes. On 80 confirmation histories, Qwen3-32B matches 87 hidden references among 203 insufficient raw-prefix instances, with only seven appropriate abstentions. A fixed-input DeepSeek-V4-Flash replication matches 85 and abstains on 21 of the same 203 instances. Each reader makes 1,600 requests. Compact CSV's estimated appropriateness effects remain inconclusive: +3.16 percentage points, clustered 95% interval [0.00,6.57], for Qwen and +2.46, [-1.84,6.94], for DeepSeek. A separate held-out judge study achieves 99.38% correctness but retains support errors and truncations; a deterministic baseline solves all constructed cases. These results support an evaluation diagnosis across two hosted reader configurations, not gains for a general memory system or natural-language evidence assessment.

cs.AI↗

When Agent Memory Needs to Compute: Evidence Access and Executable Aggregation

Questions about an agent's history often require aggregating events, which retrieval alone does not resolve. We combine source-preserving evidence access with executable aggregation. Trajectory Memory (TM) retains the original trajectory and constructs a source-addressable reading view at question time. TallyMem augments it with a reusable event ledger, model-generated event specifications and deterministic execution. With a commit-specific adaptation on 776 questions from 99 held-out MINTEval repositories, TallyMem raises Qwen3-32B exact match from 35.2% to 49.0%, a 13.8-point gain over TM; gains span 12.8-13.9 points across three readers. A controlled probe with event sets parsed independently from raw logs shows an 11.0-point gain, from 82.8% to 93.8%, without routing. On full AMA-Bench, the routed system yields a smaller 1.3-point gain, from 69.8% to 71.1%. These results support executable aggregation on tasks that require combining events, with benefits dependent on the task and event specification, the largest residual system-error category in our diagnostic analysis.

cs.AI↗

FlatLand: Personalized Graph Federated Learning via Tailored Lorentz Space

Federated learning enables privacy-preserving collaborative training, but highly heterogeneous client data remain challenging, especially in graph federated learning where clients possess structurally diverse graphs. Existing personalized federated learning (PFL) methods ignore the intrinsic geometric properties of diverse graph structures. We propose FlatLand, a novel personalized federated learning method that embeds different clients' data in tailored Lorentz space of hyperbolic geometry. Our key insight is that hyperbolic geometry naturally accommodates the intrinsic negative curvature prevalent in real-world graphs, while the time-like dimension in Lorentz space provides a principled way to encode client-specific heterogeneity. We develop a parameter decoupling strategy that separates heterogeneous information (captured in time-like parameters) from common knowledge (preserved in space-like parameters), enabling direct aggregation without requiring client similarity estimation and extra calculation modules. Empirical results on diverse federated graph learning tasks demonstrate that FlatLand achieves superior performance, particularly in low-dimensional settings.

cs.LG↗

OpenHarmony Bench: Evaluating LLMs and Coding Agents on OpenHarmony App Development

We present OPENHARMONY BENCH, an app-level coding benchmark for evaluating LLM-based coding agents on OpenHarmony ArkTS applications. Unlike function-level benchmarks, it evaluates complete app-level changes: each task requires an agent to modify a buildable ArkTS project so that a requested behavior works end to end, involving UI state, data persistence, build configuration, and platform APIs. The benchmark installs and drives the delivered application on a device to check whether the behavior is observable. It covers three input sources: natural-language feature requests (new-feature), structured scenario specifications (spec-driven), and bug descriptions (bug-fix). The benchmark contains 153 top-level tasks and 242 Feature points (F-points), where an F-point is one executable behavior check. The snapshot includes 32 new-feature tasks, 50 spec-driven tasks with 139 F-points, and 71 bug-fix tasks. The main leaderboard is scored over top-level tasks rather than independently weighted F-points. We describe the benchmark construction, statistics, and build-and-test evaluation pipeline, and evaluate DevEco Code with eight LLMs across three independent full-suite runs per configuration. Three findings emerge. First, newer generations complete more tasks than their predecessors within evaluated model-family pairs. Second, buildability is close to saturated while behavioral correctness is not: mean Final Build Success Rate is 94.77% to 100.00%, whereas mean Task Completion is 48.36% to 58.39%. Third, spec-driven tasks have the lowest Task Completion under all-checks task scoring, with no configuration exceeding 35%. The code, data, tasks, reference solutions, tests, evaluation scripts, and leaderboard are released through the official OPENHARMONY BENCH website at https://bench.matrix.openharmony.cn/.

cs.SE↗

Revisiting Degree-Corrected Spectral Clustering: a Condition-Free Spectral Analysis and Extension

Spectral clustering is a representative graph clustering technique with strong interpretability and theoretical guarantees. Degree-corrected spectral clustering (DCSC) has emerged as the state-of-the-art for this technique. While prior studies have provided impressive theoretical insights for DCSC, their analyses typically depend on specific probabilistic frameworks (e.g., stochastic block models) and conditions. In this study, we explore an alternative condition-free analysis for the clustering quality of DCSC from a pure spectral view, without any random graph models. It gives bounds for the number of mis-clustered nodes w.r.t. the optimal partition of conductance minimization while involving quantities that indicate impacts of (\romannumeral1) degree heterogeneity and (\romannumeral2) weakness of clustering structures to the clustering quality. Inspired by graph neural networks (GNNs) and their over-smoothing effect, we propose ASCENT (Adaptive Spectral ClustEring with Node-wise correcTion), a simple yet effective extension of DCSC. Different from most DCSC methods with a constant degree correction, ASCENT follows a node-wise correction scheme. It can assign different corrections for nodes via a GNN mean aggregator. We demonstrate that (\romannumeral1) ASCENT reduces to conventional DCSC methods when encountering over-smoothing; (\romannumeral2) some early stages before over-smoothing can potentially result in better clustering quality.

cs.SI↗

On the Non-decoupling of Supervised Fine-tuning and Reinforcement Learning in Post-training

Post-training of large language models routinely interleaves supervised fine-tuning (SFT) with reinforcement learning (RL). These two methods have different objectives: SFT minimizes the cross-entropy loss between model outputs and expert responses, while RL maximizes reward signals derived from human preferences or rule-based verifiers. Modern reasoning models have widely adopted the practice of alternating SFT and RL training. However, there is no theoretical account of whether they can be decoupled. We prove that decoupling is impossible in either order: (1) SFT-then-RL coupling: RL increases SFT loss under both distributional (KL-based) and landscape (PL-based) analyses; and (2) RL-then-SFT coupling: SFT lowers the reward achieved by RL under analogous conditions. Under the PL condition, we further derive the optimal RL duration that balances reward improvement against SFT degradation, identify the non-decoupling threshold governing when RL can improve SFT, and bound the gradient misalignment via spectral concentration. Experiments on Qwen3-0.6B confirm the predicted degradation, verifying that SFT and RL cannot be separated without loss of prior performance in the post-training pipeline.

cs.LG↗

Equivalent spectral theory for fundamental graph cut problems

We introduce and develop equivalent spectral graph theory for several fundamental graph cut problems including maxcut, mincut, Cheeger cut, anti-Cheeger cut, dual Cheeger problem and their useful variants. A specified strategy for achieving an equivalent eigenproblem is proposed for a general graph cut problem via the set-pair Lovász extension and the Dinkelbach scheme. For a class of 2-cut and 3-cut problems, we reveal the intrinsic difference-of-submodularity for the fractional formulations and show that their set-pair Lovász extensions yield equivalent difference-of-convex structures. Building on the Dinkelbach scheme, we finally establish a unified research roadmap for nonlinear spectral theory that provides a one-to-one correspondence between certain eigenpairs and the optimal graph cut problems. The finer structure of the eigenvectors, the Courant nodal domain theorem and the graphic feature of eigenvalues are studied systematically in the setting of these new nonlinear eigenproblems.

math.CO↗

Type III Valley Polarization and Anomalous Valley Hall Effect in Two-Dimensional Non-Janus and Janus Altermagnet Fe2WS2Se2

Exploiting the valley degree of freedom introduces a novel paradigm for advancing quantum information technology. Currently, the investigation on spontaneous valley polarization mainly focuses on two major types of systems. One type magnetic systems by breaking the time-reversal symmetry, the other is ferroelectric materials through breaking the inversion symmetry. Might there be additional scenarios? Here, we propose to realize spontaneous valley polarization by breaking the mirror symmetry in the altermagnets, named type III valley polarization. Through symmetry analysis and first-principles calculations, we confirm that this mechanism is feasible in Non-Janus Fe2WS2Se2. Monolayer Non-Janus and Janus Fe2WS2Se2 are stable Neel-type antiferromagnetic state with the direct band gap semiconductor. More interestingly, their magnetic anisotropy energy exhibits the rare biaxial anisotropy and a four-leaf clover shape in the xy plane, while the xz and yz planes show the common uniaxial anisotropy. This originated from the fourth-order single ion interactions. More importantly, the valley splitting is spontaneously generated in the Non-Janus Fe2WS2Se2 due to the Mxy symmetry breaking, without requiring the SOC effect. Both the Non-Janus and Janus Fe2WS2Se2 exhibit diverse valley polarization and anomalous valley Hall effect properties. In addition, the magnitude and direction of valley polarization can be effectively tuned by the biaxial strain and magnetic field. Our findings not only expand the realization system of spontaneous valley polarization, but also provide a theoretical basis for the high-density storage of valley degrees of freedom.

cond-mat.mtrl-sci↗

AdaptCLIP: Adapting CLIP for Universal Visual Anomaly Detection

Universal visual anomaly detection aims to identify anomalies from novel or unseen vision domains without additional fine-tuning, which is critical in open scenarios. Recent studies have demonstrated that pre-trained vision-language models like CLIP exhibit strong generalization with just zero or a few normal images. However, existing methods struggle with designing prompt templates, complex token interactions, or requiring additional fine-tuning, resulting in limited flexibility. In this work, we present a simple yet effective method called AdaptCLIP based on two key insights. First, adaptive visual and textual representations should be learned alternately rather than jointly. Second, comparative learning between query and normal image prompt should incorporate both contextual and aligned residual features, rather than relying solely on residual features. AdaptCLIP treats CLIP models as a foundational service, adding only three simple adapters, visual adapter, textual adapter, and prompt-query adapter, at its input or output ends. AdaptCLIP supports zero-/few-shot generalization across domains and possesses a training-free manner on target domains once trained on a base dataset. AdaptCLIP achieves state-of-the-art performance on 12 anomaly detection benchmarks from industrial and medical domains, significantly outperforming existing competitive methods. We will make the code and model of AdaptCLIP available at https://github.com/gaobb/AdaptCLIP.

cs.CV↗

PilotANN: Memory-Bounded GPU Acceleration for Vector Search

Approximate Nearest Neighbor Search (ANNS) has become fundamental to modern deep learning applications, having gained particular prominence through its integration into recent generative models that work with increasingly complex datasets and higher vector dimensions. Existing CPU-only solutions, even the most efficient graph-based ones, struggle to meet these growing computational demands, while GPU-only solutions face memory constraints. As a solution, we propose PilotANN, a hybrid CPU-GPU system for graph-based ANNS that utilizes both CPU's abundant RAM and GPU's parallel processing capabilities. Our approach decomposes the graph traversal process of top-$k$ search into three stages: GPU-accelerated subgraph traversal using SVD-reduced vectors, CPU refinement and precise search using complete vectors. Furthermore, we introduce fast entry selection to improve search starting points while maximizing GPU utilization. Experimental results demonstrate that PilotANN achieves $3.9 - 5.4 \times$ speedup in throughput on 100-million scale datasets, and is able to handle datasets up to $12 \times$ larger than the GPU memory. We offer a complete open-source implementation at https://github.com/ytgui/PilotANN.

cs.DC↗

A Review and Collection of Metrics and Benchmarks for Quantum Computers: definitions, methodologies and software

Quantum computers have the potential to provide an advantage over classical computers in a number of areas. Numerous metrics to benchmark the performance of quantum computers, ranging from their individual hardware components to entire applications, have been proposed over the years. Navigating the resulting extensive literature can be overwhelming. Objective comparisons are further hampered in practice as different variations of the same metric are used, and the data disclosed together with a reported metric value is often not sufficient to reproduce the measurements. This article addresses these challenges by providing a review of metrics and benchmarks for quantum computers and 1) a comprehensive collection of benchmarks allowing holistic comparisons of quantum computers, 2) a consistent format of the definitions across all metrics including a transparent description of the methodology and of the main assumptions and limitations, and 3) a reproducible approach by linking the metrics to open-source software used to evaluate them. We identify five areas where international standardization working groups could be established, namely: i) the identification and agreement on the categories of metrics that comprehensively benchmark device performance; ii) the identification and agreement on a set of well-established metrics that together comprehensively benchmark performance; iii) the identification of metrics specific to hardware platforms, including non-gate-based quantum computers; iv) inter-laboratory comparison studies to develop best practice guides for measurement methodology; and v) agreement on what data and software should be reported together with a metric value to ensure trust, transparency and reproducibility. We provide potential routes to advancing these areas. We expect this compendium to accelerate the progress of quantum computing hardware towards quantum advantage.

quant-ph↗

A Comprehensive Monte Carlo Simulation Tool on Electron Transport in Noble Gases and Liquids

For the particle detectors based on noble gases or liquids, it is essential to understand the transport dynamic and the properties of the electrons. We report the development of a tool for electron transport in noble gases He, Ne, Ar, Kr, or Xe, and liquids Ar, Kr, or Xe. The simulation, implemented in C++ and MATLAB, is based on electron-atom collisions, including elastic scattering, excitation and ionization. We validate the program through assessing the electron's swarm parameters, specifically the drift velocity and the diffusion coefficient. For electron transport in liquids, two models are discussed and both are used for the construction of the Monte Carlo framework based on the Cohen Leker theory. The results demonstrate the effectiveness and accuracy of the simulation tool, which offers a valuable support for detector design and data analysis.

physics.ins-det↗

Multifield tunable valley splitting and anomalous valley Hall effect in two-dimensional antiferromagnetic MnBr

Compared to the ferromagnetic materials that realize the anomalous valley Hall effect by breaking time-reversal symmetry and spin-orbit coupling, the antiferromagnetic materials with the joint spatial inversion and time-reversal (PT) symmetry are rarely reported that achieve the anomalous valley Hall effect. Here, we predict that the antiferromagnetic monolayer MnBr possesses spontaneous valley polarization. The valley splitting of valence band maximum is 21.55 meV at K and K' points, which is originated from Mn-dx2-y2 orbital by analyzing the effective Hamiltonian. Importantly, monolayer MnBr has zero Berry curvature in the entire momentum space but non-zero spin-layer locked Berry curvature, which offers the condition for the anomalous valley Hall effect. In addition, the magnitude of valley splitting can be signally tuned by the onsite correlation, strain, magnetization rotation, electric field, and built-in electric field. The electric field and built-in electric field induce spin splitting due to breaking the P symmetry. Therefore, the spin-layer locked anomalous valley Hall effect can be observed in MnBr. More remarkably, the ferroelectric substrate Sc2CO2 can tune monolayer MnBr to realize the transition from metal to valley polarization semiconductor. Our findings not only extend the implementation of the anomalous valley Hall effect, but also provides a platform for designing low-power and non-volatile valleytronics devices.

cond-mat.mtrl-sci↗

Ferroelectric tuning of the valley polarized metal-semiconductor transition in Mn2P2S3Se3/Sc2CO2 van der Waals heterostructures and application to nonlinear Hall effect devices

In order to promote the development of the next generation of nano-spintronic devices, it is of great significance to tune the freedom of valley in two-dimensional (2D) materials. Here, we propose a mechanism for manipulating the valley and nonlinear Hall effect by the 2D ferroelectric substrate. The monolayer Mn2P2S3Se3 is a robust antiferromagnetic valley polarized semiconductor. Importantly, the valley polarized metal-semiconductor phase transition of Mn2P2S3Se3 can be effectively tuned by switching the ferroelectric polarization of Sc2CO2. We reveal the microscopic mechanism of phase transition, which origins from the charge transfer and band alignment. Additionally, we find that transformed polarization direction of Sc2CO2 flexibly manipulate the Berry curvature dipole. Based on this discovery, we present the detection valley polarized metal-semiconductor transition by the nonlinear Hall effect devices. These findings not only offer a scheme to tune the valley degree of freedom, but also provide promising platform to design the nonlinear Hall effect devices.

cond-mat.mtrl-sci↗

Towards Faster Graph Partitioning via Pre-training and Inductive Inference

Graph partitioning (GP) is a classic problem that divides the node set of a graph into densely-connected blocks. Following the IEEE HPEC Graph Challenge and recent advances in pre-training techniques (e.g., large-language models), we propose PR-GPT (Pre-trained & Refined Graph ParTitioning) based on a novel pre-training & refinement paradigm. We first conduct the offline pre-training of a deep graph learning (DGL) model on small synthetic graphs with various topology properties. By using the inductive inference of DGL, one can directly generalize the pre-trained model (with frozen model parameters) to large graphs and derive feasible GP results. We also use the derived partition as a good initialization of an efficient GP method (e.g., InfoMap) to further refine the quality of partitioning. In this setting, the online generalization and refinement of PR-GPT can not only benefit from the transfer ability regarding quality but also ensure high inference efficiency without re-training. Based on a mechanism of reducing the scale of a graph to be processed by the refinement method, PR-GPT also has the potential to support streaming GP. Experiments on the Graph Challenge benchmark demonstrate that PR-GPT can ensure faster GP on large-scale graphs without significant quality degradation, compared with running a refinement method from scratch. We will make our code public at https://github.com/KuroginQin/PRGPT.

cs.LG↗

Pre-train and Refine: Towards Higher Efficiency in K-Agnostic Community Detection without Quality Degradation

Community detection (CD) is a classic graph inference task that partitions nodes of a graph into densely connected groups. While many CD methods have been proposed with either impressive quality or efficiency, balancing the two aspects remains a challenge. This study explores the potential of deep graph learning to achieve a better trade-off between the quality and efficiency of K-agnostic CD, where the number of communities K is unknown. We propose PRoCD (Pre-training & Refinement fOr Community Detection), a simple yet effective method that reformulates K-agnostic CD as the binary node pair classification. PRoCD follows a pre-training & refinement paradigm inspired by recent advances in pre-training techniques. We first conduct the offline pre-training of PRoCD on small synthetic graphs covering various topology properties. Based on the inductive inference across graphs, we then generalize the pre-trained model (with frozen parameters) to large real graphs and use the derived CD results as the initialization of an existing efficient CD method (e.g., InfoMap) to further refine the quality of CD results. In addition to benefiting from the transfer ability regarding quality, the online generalization and refinement can also help achieve high inference efficiency, since there is no time-consuming model optimization. Experiments on public datasets with various scales demonstrate that PRoCD can ensure higher efficiency in K-agnostic CD without significant quality degradation.

cs.SI↗