Search arXiv⌕ Search

arXiv subjects

Qian Zhang

Publications and source records attributed to Qian Zhang.

At least 19 recordsLinked to original sources

Precedent or Intent? What Coding Agents Follow When Evolving Existing Code

Existing code reveals past implementation decisions but rarely explains the reasoning behind them. When coding agents implement new features or modify existing functionality, past decisions may conflict with new task instructions. This raises a fundamental question for agentic software evolution: when multiple implementations satisfy the same functional requirements, how do coding agents decide whether to follow existing code or new task instructions? We investigate this question through bidirectional, controlled experiments in purpose-built repositories, followed by validation in real-world open-source repositories. Our approach isolates three competing sources of guidance: (1) agents' default preferences, (2) repository precedents, and (3) explicit task instructions. We conduct 5,625 trials across four coding agents and six implementation pairs, with validation in four open-source repositories spanning three programming languages. We find that agents share the same default implementation choices, yet overwhelmingly follow repository precedent when it conflicts with those defaults (359/360 trials). Crucially, not all precedents carry equal influence: three supporting local files yield 96% adoption, compared with only 4% for sibling-resource files, and changing file placement alone can shift adoption from 0% to 100% at a fixed example count. When new task intent conflicts with existing code, written priority rules achieve substantially higher success than code examples alone (59/60 versus 38/60 joint successes for two agents on two implementation pairs). The effectiveness of explicit rules also extends to open-source repositories, where a harness-loaded rule raises joint success from 0/120 to 117/120. These findings motivate design-decision traceability that preserves not only implementation choices but also the rationale and priorities that should guide future changes.

cs.SE↗

SemLoc: Structured Grounding of Free-Form LLM Reasoning for Fault Localization

Large language models (LLMs) can describe what a piece of code should compute, but they do so in free-form text. Such text cannot be checked against program executions, and it does not reveal whether a statement is correct. We present SemLoc, which turns LLM reasoning into executable, verifiable semantic constraints. With structured semantic grounding, the LLM writes each property as a constraint with a fixed category, attached to an anchor in the code graph, such as a variable definition, branch, loop, or return. SemLoc inserts each constraint as a runtime check and runs the tests, which yields a semantic violation spectrum over passing and failing tests. Counterfactual verification then patches the code at an anchor and reruns the tests; a patch that a constraint suggests counts as verified only if all tests then pass. We study SemLoc on fault localization, where the tests serve as the oracle for verification, with four LLMs on QuixBugs and on SemBugs, a new dataset of 809 real bugs from 750 GitHub projects. The constraints are executable: 99.4% become runtime checks, and on programs where coverage ties the faulty line with at least half of the covered lines, their violations alone rank it first in 40.9% of the cases, compared with 2.2% for spectrum-based fault localization and 7.0% for Daikon invariants. They make the LLM's answers verifiable: 68.4% of SemLoc's top-ranked answers carry a patch that the tests confirm, and 93.6% of these are correct, which the LLM's own confidence cannot match. SemLoc's first-rank accuracy does not differ significantly, for any of the four LLMs, from that of an LLM given the same inputs (81.4% vs. 82.0%), and it far exceeds that of an LLM that sees only the function (50.0%).

cs.SE↗

CropReward: A Human-Preference Benchmark and Reward Model for Aesthetic Image Cropping

Aesthetic image cropping (AIC) aims to improve image composition and aesthetic quality by removing extraneous or distracting content. Over the past decade, AIC methods have evolved from specialized vision models to multimodal large language models(MLLMs). Reliable evaluation that reflects human preferences is essential for benchmarking AIC methods and guiding model optimization. However, the current AIC evaluation relies largely on geometry-based metrics such as intersection over union (IoU), as well as image aesthetic assessment(IAA) models. Although inconsistencies with human preferences have long been observed, the robustness and reliability of these evaluation criteria remain underexplored. To bridge this gap, we first construct CropBench, a large-scale benchmark comprising 106,995 human preference pairs for 1,019 images, with each candidate set containing the original image and candidate crops produced by 14 AIC methods. A systematic study on CropBench reveals that the existing criteria, ranging from IoU to off-the-shelf IAA assessment models, only exhibit limited alignment with human preferences. Building upon CropBench, we further propose CropReward, an MLLM-based reward model that evaluates a candidate crop by comparing with the original uncropped image and outputs a score indicating explicit aesthetic improvement or degradation relative to the original. In addition, we employ CropReward to construct CropReward-300k, the largest AIC dataset to date, and further develop CropAlign, a preference-aligned AIC model trained solely with CropReward supervision, without human-annotated crop boxes. Experimental results demonstrate that CropReward aligns with human preferences significantly better than AIC existing criteria. CropAlign also surpasses the state-of-the-art AIC methods, demonstrating the advantage of CropReward in guiding AIC model optimization.

cs.CV↗

Does More Thinking Pay Off? Reasoning Cost and Correctness of LLMs in Code Generation and Bug Fixing

Many LLMs now emit an explicit reasoning trace before they write code, but benchmark results for code generation and bug fixing usually report correctness alone. It is therefore unclear how much the extra reasoning contributes relative to the tokens it consumes. We examine this question with 866 Python tasks drawn from HumanEval Pro, MBPP Pro, and BugsInPy under five model settings. We look at the accuracy gain and token overhead of reasoning, the behaviors that appear inside reasoning traces, and whether a shortened trace still leads to a correct solution. Turning reasoning on in Qwen3-32B over five runs improves mean pass@1 on HumanEval Pro from 71.1% to 76.5% and mean tests pass on BugsInPy from 3.5% to 7.9%. On MBPP Pro the improvement from 68.1% to 69.5% is not statistically significant, even though the model uses a median of over 2,000 thinking tokens per task. Across models, a longer median trace does not reliably mean higher accuracy. A qualitative analysis shows that traces mostly choose and check an implementation in code generation, while in bug fixing they mostly locate the fault and plan the repair. We then truncate stored traces offline and ask Qwen3-32B with reasoning off to produce a solution from what remains. Retaining the first half of a trace yields no statistically significant drop in correctness. Stopping when the trace becomes repetitive seldom triggers, and stopping once solution code first appears benefits some models but harms others. Neither rule beats plain fixed truncation. These results suggest that more reasoning is not always better and that studies should report reasoning cost alongside correctness.

cs.SE↗

An energy- and helicity-conserving enriched galerkin method for the incompressible Navier-Stokes equations

We develop an enriched Galerkin (EG) method for the incompressible Navier-Stokes equations that conserves both kinetic energy and helicity in the inviscid limit without introducing any additional projection variables. The method employs an EG velocity space, which is the first-order continuous Galerkin space enriched with piecewise constants defined on mesh faces, together with piecewise-constant pressure. Two numerical schemes based on the rotational form of the convective term are proposed: a nonlinear scheme and a linear variant. Both schemes exactly preserve the discrete helicity and kinetic energy, and the Picard iteration maintains the conservation properties of the nonlinear scheme. We prove the conservation properties of both the methods, and establish stability and rigorous error estimates for the nonlinear scheme. Numerical examples demonstrate the accuracy and conservation of the proposed linear scheme.

math.NA↗

HorizonStream: Long-Horizon Attention for Streaming 3D Reconstruction

Online 3D reconstruction requires estimating camera pose and scene geometry under strict causal and bounded-memory constraints. Existing methods often suffer from drift, jitter, or collapse on long sequences. We trace these failures to a fundamental mismatch. Streaming geometry is inherently temporally heterogeneous, with evidence ranging from short-lived correspondences to persistent global scale. However, current architectures impose uniform and pathological influence patterns. For example, sliding windows enforce hard cutoffs, while ungated recurrence and causal attention cause cache saturation and spike-like attention sinks. To resolve this, we formalize geometric propagation as an \emph{evidence influence kernel} and propose HorizonStream, a long-horizon Transformer that explicitly factorizes this kernel. For the long-range temporal factor, Geometric Linear Attention learns channel-wise decay rates to enable bounded, multi-timescale propagation of geometric evidence. For the short-range spatial factor, Geometric Local Attention with Spatiotemporal RoPE performs reliable 3D matching while suppressing attention sinks. Finally, Metric Readout Tokens recover stable scale and rigid pose directly from the persistent geometric state. Extensive experiments show that HorizonStream, trained on only 48-frame clips, generalizes stably to sequences exceeding 10,000\ frames with constant memory and linear time, achieving state-of-the-art streaming 3D reconstruction performance. Project Page: https://3dagentworld.github.io/horizonstream/

cs.CV↗

A linear dual-field finite element method for incompressible MHD, part I: cross-helicity and Alfvénic alignment in periodic domains

Cross helicity, together with total energy, determines the Elsässer energies and thus quantifies departures from Alfvénic alignment in incompressible MHD. Building on the dual-field method in [Mao and Xi, \emph{J. Comput. Phys.}, 2025], we construct a linear finite element method for periodic domains that reproduces the cross-helicity balance. We connect the discrete energy and cross-helicity conservation laws to Alfvénic alignment through a nonnegative Elsässer-energy representation, establishing preservation of the corresponding exact relation when either Elsässer energy is initially zero in the unforced ideal case. We reassign the two discrete approximations of the magnetic field to the integer and half-integer time levels and redesign the Lorentz and induction couplings within the Mao-Xi formulation. The resulting scheme uses linear staggered updates and retains the energy balances, strong and weak divergence-free properties, and magnetic- and fluid-helicity balances. Numerical experiments illustrate the role of the cross-helicity balance in preserving an aligned state in the ideal case and in alignment dynamics under weak dissipation.

math.NA↗

A Transformer-based Approach for Real-time Multi-agent Path Planning with Varying Initial/Final Conditions

We address the problem of real-time multi-agent path planning under prescribed initial and final configurations, formulated as a high-dimensional optimal control problem subject to inter-agent collision avoidance and obstacle constraints. Classical solvers based on the Hamilton--Jacobi--Bellman equation or Pontryagin's maximum principle (PMP) become computationally intractable as the number of agents grows, due to the curse of dimensionality and the non-convexity introduced by interaction constraints. We propose OCFormer, a transformer-based neural network that parameterizes the inverse of a coordinate transformation mapping a simple, analytically tractable latent space, in which agents evolve independently under a decoupled Hamiltonian, to the physical space of the coupled, interacting system. The model is trained by minimizing a physics-informed loss comprising the Hamiltonian ODE residual from the PMP and a boundary matching term, without requiring pre-computed trajectory data. The self-attention mechanism endows OCFormer with permutation equivariance over agents, a structural symmetry that prior symplectic network approaches do not natively enforce. When trained on a distribution of boundary conditions, the amortized OCFormer produces near-optimal trajectories for unseen initial and final configurations in a single forward pass ($\sim$220ms), enabling real-time inference without retraining. We further introduce a lightweight transfer learning framework that adapts a pretrained OCFormer to out-of-distribution perturbations in seconds via L-BFGS fine-tuning. Numerical experiments on two- and three-dimensional multi-agent navigation with up to 128 agents demonstrate the scalability and efficiency of the proposed approach.

math.OC↗

Synthesis and stability of high-$T_c$ LaH$_{10\pmδ}$ films at high pressures

High-pressure hydrides hold the record for the highest superconducting critical temperatures across all classes of superconductors. Currently lanthanum decahydride, LaH$_{10}$, exhibits the highest critical temperature among binaries, with $T_c \approx$ 250 K at pressures between 140-180 GPa. Here, we report the synthesis of LaH$_{10\pmδ}$ films in two DACs at pressures of 168 GPa and 176 GPa via in situ laser heating of elemental lanthanum films with ammonia borane (NH$_3$BH$_3$) as the hydrogen donor. The high-symmetry fcc lanthanum sublattice (space group $Fm\bar3m$) is resolved using synchrotron X-ray diffraction, with unit cell parameters in excellent agreement with previous studies on bulk samples. We provide confirmation of high-$T_c$ superconductivity in LaH$_{10\pmδ}$ with highest $T_c$ of 247 K at 176 GPa evidenced in electrical measurements. The characteristic suppression of superconductivity is observed in magnetic fields. Furthermore, combined diffraction and electrical measurements reveal remarkable temporal stability of both the crystal structure and the high-$T_c$ superconductivity over the full measurement period of about 300 days post laser heating. Our work establishes film precursors using physical vapour deposition (PVD) techniques as a practical route to hydride formation, opening a pathway toward the controlled synthesis of promising ternary hydrides and the integration of micro-fabricated device geometries in diamond anvil cells.

cond-mat.supr-con↗

Latent Bridge: From Video Latents to 3D Geometry via Feature Alignment

Video generation and feed-forward 3D reconstruction typically use separate representations, requiring RGB decoding and visual re-encoding to recover geometry from generated latents. We propose Latent Bridge, which connects video generative latent spaces with geometric feature spaces to directly predict 3D geometry from video latents. We develop representation-specific bridges for Wan2.1 and V-RAE, enabling feed-forward prediction of cameras, depth, and 3D point clouds without the intermediate RGB pathway. Each bridge is trained on RGB videos through feature distillation, while the video encoder and geometry model remain frozen. Training requires neither ground-truth geometry nor execution of the downstream geometric aggregator or prediction heads. At inference, the same video latents support both RGB decoding and geometry prediction. The same trained bridge can be reused for image-to-video and text-to-video generation within the same video latent space, without bridge retraining. Experiments on Co3Dv2 and WildRGB-D demonstrate competitive geometric reconstruction quality, efficient end-to-end generation and reconstruction, and faster latent-to-geometry decoding, highlighting latent alignment as a practical and reusable interface between video generation and 3D reconstruction. Our code is available at: https://github.com/hustvl/Latent-Bridge.

cs.CV↗

SPACE: Swarm Pheromone Fields for Adaptive Collision-Aware Exploration

Massive robot swarms can explore unknown environments quickly, but adding robots eventually stops helping. Doorways and dense traffic create congestion, increasing inter-robot contacts and reducing the value of each additional robot. We study this safety-efficiency tradeoff for ground swarms of tens to hundreds of robots. We present SPACE, Swarm Pheromone Fields for Adaptive Collision-Aware Exploration. Inspired by ant foraging, SPACE maintains a shared environmental field with an attractive frontier pheromone, a repellent explore pheromone, and a fast robot-density field. Robots use local field guidance on a synchronized shared map. We evaluate SPACE on real building floorplans, namely sixteen home layouts from the HouseExpo dataset and eight campus floors from the KTH dataset, with swarms of up to two hundred and fifty-six robots. At congested swarm sizes, SPACE attains the lowest inter-robot contact rate on HouseExpo and lies on the empirical Pareto frontier on KTH, together with handed lane formation at sizes where Lane has fewer contacts. Relative to a greedy nearest-frontier planner, SPACE reduces the contact rate by four to seventeen times while keeping coverage time within about two percent. The results indicate that, at this scale, coordination mainly improves safety rather than coverage time.

cs.RO↗

Are We Testing the Wrong Quantum Bugs? A Study of Fault Representation Gaps in Quantum Software Testing

Quantum software relies on compilers, intermediate representations, and execution frameworks that transform programs before execution. Faults in these components can change the behavior of otherwise correct quantum programs. Yet quantum testing techniques are often evaluated using mutation-generated faults and curated bug benchmarks. We investigate how well the faults represented by these artifacts reflect those encountered in modern quantum software. We audit four quantum mutation-testing tools and three curated bug benchmarks, and collect 410 verified bugs from ten quantum software repositories over two years. We classify faults from all three sources into a common taxonomy of 56 bug families and compare their representation across mutation operators, curated benchmarks, and recent real-world bugs. The mutation tools support 20 bug families, and curated benchmarks add 15 more. Yet only 56 of the 410 real-world bugs (13.7%) belong to families represented by either source; the remaining 354 (86.3%) belong to families absent from both. The largest unrepresented families concern compiler transformations (66 bugs), type handling (53), and input validation (47). Unlike local gate or statement changes, these faults often depend on intermediate representations, compiler pipelines, input types, or dependency versions. Existing mutation operators primarily modify circuits and program constructs, whereas many real-world faults arise in the compilers, representations, and framework interfaces that process them. Addressing this gap requires looking beyond circuit-level faults toward testing semantic preservation across compiler transformations, correctness at representation boundaries, and interactions between software components. Our study provides empirical evidence to guide fault models and benchmarks that capture these mechanisms and preserve the contexts needed to reproduce them.

cs.SE↗

SenseSwarm: Swarm Exploration via Neural Structure Estimation with Shared World-Anticipation for Rapid Mapping

A robot swarm covers a building faster with more robots, but the map is only as complete as the space the robots have physically visited. We target the amount of an unknown building a decentralized swarm knows at each instant, ahead of physical coverage. SenseSwarm serves a lightweight learned map predictor on the swarm's shared occupancy map and folds the predicted structure back into a stigmergic guidance field. Its 709K-parameter predictor is fine-tuned on the swarm's own multi-front observations, which we show is necessary: a single-robot predictor collapses on such views. We build a benchmark of twelve real building floors from HouseExpo, HKUST, and KTH, up to 24,000 square meters, and run 1,620 simulations across nine coordination methods, swarm sizes 32 to 512, and three seeds. On physical coverage the swarm is near parity with a greedy frontier planner, as expected. On map reconstruction, every non-predictive baseline needs 1.3 to 1.9 times longer to reach an 80 percent known map, and SenseSwarm holds an equal-time area lead of about 670 square meters, up to 1,359. Folding the prediction into the shared field matters: the same predictor applied per robot matches our speed but suffers a 6.9 times higher inter-robot contact rate at 512 robots. The prediction is computed once per shared map, so its cost stayed flat from 32 to 512 robots.

cs.RO↗

Isolating Recurring Backend-Dependent Abnormal Patterns on NISQ Quantum Devices

Quantum hardware remains highly susceptible to noise, making compilation a critical step for obtaining reliable execution on existing devices. Today's quantum compilers approximate hardware noise using calibration-derived costs over gates, qubits, and coupling edges, and use the costs to guide qubit mapping, routing, and scheduling. However, this abstraction is incomplete: semantically equivalent circuits with identical compiler-predicted hardware noise can still behave very differently on real devices. Execution context can contribute to this gap: short ordered gate sequences on specific qubit neighborhoods can be associated with hardware-model mismatch. Identifying these backend-dependent abnormal patterns can guide gate-ordering rewrites in the circuit family and layout where they were observed. To find these patterns, we propose QRisk, a framework that isolates recurring abnormal gate sequences from quantum hardware executions. QRisk starts from a circuit whose hardware output is much worse than predicted by the calibration-based noise model. It then reduces the circuit at the segment level, identifying groups of segments whose removal lowers the discrepancy ratio or whose retention within the tested circuit context preserves an elevated ratio. The resulting circuit fragments are treated as candidate abnormal patterns. On three IBM Heron r2 backends (quantum devices) across 30 qubit layouts, QRisk finds 25 recurring abnormal gate patterns. Reordering commuting gates to break the two highest-recurrence patterns in their Grover discovery circuits reduces mean hardware-model mismatch by 24% on ibm_fez and 45% on ibm_marrakesh.

cs.SE↗

A Stabilized CR-CR Method for Fourth-Order Elliptic Problems

We present a CR-CR method for strain gradient elasticity and prove its robustness with respect to the Lame parameter $λ$ and the length scale $ι$. The method introduces the strain as an independent symmetric tensor and discretizes both the strain and the displacement using CR elements. The commuting properties of the CR interpolation operator with the relevant differential operators leads the robustness with respect to $λ$. A stabilization term weakly imposes the relation between the strain and the symmetric gradient of the displacement. The method also applies directly to the biharmonic equation and singularly perturbed fourth-order problems. For these problems, we prove that the CR-CR method is equivalent to an RT-CR method proposed by Huang and Tang. This result extends the classical equivalence between the RT-P0 mixed method and the CR method for the Poisson equation to fourth-order problems. The equivalence shows that the stabilization term arises naturally from the RT-CR mixed formulation.

math.NA↗

Beyond ICD Codes: Semantic IDs for Generative Medical Coding

Generative approaches to automatic International Classification of Diseases (ICD) coding use large language models (LLMs) to predict ICD codes from clinical documents. However, original ICD code strings are not ideal generation targets because the ICD hierarchy does not always reflect clinical relationships, and LLMs struggle to interpret and generate these codes. We introduce SemICD, a framework that trains LLMs to generate Semantic IDs (SIDs) instead. SemICD constructs SIDs by hierarchically clustering embeddings of textual code profiles, allowing semantically related codes to share prefixes while each complete SID uniquely identifies one ICD code. To align the SID tokens with clinical semantics, we employ two auxiliary tasks for bidirectional generation between textual code profiles and SIDs. Experiments on MIMIC-III and MIMIC-IV with four LLMs show that SemICD outperforms direct code generation, improving Micro-F1 by 1.34-8.00 points. Our code is available at https://github.com/youwillbethebest/SemICD.

cs.AI↗

PTGPO: Prefix Tree Group Policy Optimization

Training language agents on long-horizon interactive tasks is challenging because sparse terminal rewards provide weak credit signals for intermediate actions. Existing group-based methods either assign a shared trajectory-level advantage or estimate step-level advantages from state groups, which may conflate the current action with subsequent decisions. We propose Prefix Tree Group Policy Optimization (PTGPO), a critic-free method that constructs prefix trees over trajectory suffixes within anchor-state groups. PTGPO assigns each tree edge a credit given by the difference between its child and parent empirical mean returns, capturing the conditional return change revealed by each additional action. These prefix-tree credits provide fine-grained learning signals without requiring a critic or additional rollouts. Experiments on interactive benchmarks ALFWorld, WebShop and Sokoban show that PTGPO consistently improves over RL baselines, demonstrating its effectiveness.

cs.LG↗

Sum Rate Maximization for Practical RIS-Enhanced Rate-Splitting Multiple Access Systems

Reconfigurable intelligent surfaces (RIS) combined with rate-splitting multiple access (RSMA) provide a promising solution for improving the spectral efficiency (SE) of sixth-generation (6G) communication systems. However, most existing studies neglect the practical coupling between the RIS phase shift and amplitude, which may cause phase-shift mismatch and significant performance loss. In this paper, we investigate the multiuser sum-rate maximization problem for practical RIS-enhanced RSMA systems considering amplitude-phase coupling. To address the resulting non-convex problem, an effective variable separation algorithm is proposed. The proposed algorithm is compatible with RIS reflecting optimization under the continuous phase shift or any amplitude-phase coupling relationship and can also be directly extended to practical RIS-enhanced NOMA and OMA systems. Simulation results demonstrate performance gain of over 190\% compared with the ideal-RIS-based benchmark, while the proposed RSMA scheme significantly outperforms the corresponding NOMA and OMA schemes.

cs.IT↗