Search arXiv⌕ Search

arXiv subjects

Hui Sun

Publications and source records attributed to Hui Sun.

At least 19 recordsLinked to original sources

Benchmarking Traditional and Learning-Based Reference-Free Compressors for Long-Read Sequencing Data

Long-read sequencing technologies generate large volumes of data, creating substantial storage and transmission demands. Although reference-based compressors can achieve high compression, their reliance on an appropriate reference genome limits their use. We present LRCBench, a benchmark and survey of reference-free lossless compressors for long-read sequencing data. We review traditional and learning-based general-purpose and sequencing-specific methods, then evaluate 35 compressors on 16 real-world datasets from Oxford Nanopore and PacBio platforms. We compare compression ratio, storage savings, runtime, peak memory use, and robustness across datasets. Learning-based compressors are evaluated on six MinION datasets because of their high computational costs. CoLoRd achieves the best overall compression ratios in our experiments, while other methods offer trade-offs in speed, memory use, and robustness. We also examine multithreaded speedup and discuss future directions in parallel acceleration, privacy protection, adaptive parameter tuning, and hardware-algorithm co-design.

cs.IT↗

Project Imaging-X: A Survey of 1000+ Open-Access Medical Imaging Datasets for Foundation Model Development

Foundation models have demonstrated remarkable success across diverse domains and tasks, primarily due to the thrive of large-scale, diverse, and high-quality datasets. However, in the field of medical imaging, the curation and assembling of such medical datasets are highly challenging due to the reliance on clinical expertise and strict ethical and privacy constraints, resulting in a scarcity of large-scale unified medical datasets and hindering the development of powerful medical foundation models. In this work, we present the largest survey to date of medical image datasets, covering over 1,000 open-access datasets with a systematic catalog of their modalities, tasks, anatomies, annotations, limitations, and potential for integration. Our analysis exposes a landscape that is modest in scale, fragmented across narrowly scoped tasks, and unevenly distributed across organs and modalities, which in turn limits the utility of existing medical image datasets for developing versatile and robust medical foundation models. To turn fragmentation into scale, we propose a metadata-driven fusion paradigm (MDFP) that integrates public datasets with shared modalities or tasks, thereby transforming multiple small data silos into larger, more coherent resources. Building on MDFP, we release an interactive discovery portal that enables end-to-end, automated medical image dataset integration, and compile all surveyed datasets into a unified, structured table that clearly summarizes their key characteristics and provides reference links, offering the community an accessible and comprehensive repository. By charting the current terrain and offering a principled path to dataset consolidation, our survey provides a practical roadmap for scaling medical imaging corpora, supporting faster data discovery, more principled dataset creation, and more capable medical foundation models.

cs.CV↗

Discovery of a Short-Duration Fast X-ray Transient Associated with a Short Gamma-Ray Burst

Extragalactic fast X-ray transients (EFXTs) are an emerging population of high-energy transients with diverse physical origins. Only a few observed EFXTs are associated with compact object mergers, and the known events generally display X-ray emission lasting much longer than their associated short gamma-ray bursts (GRBs). Here we report EP260411a, an $\sim8$-s EFXT discovered in archival Einstein Probe Wide-field X-ray Telescope (EP-WXT) observations through a time-targeted search for X-ray counterparts of short GRBs. This fast X-ray transient is temporally coincident with short GRB 260411A, with both the pulse width and peak time showing clear anticorrelations with the characteristic photon energy across the gamma-ray and soft X-ray bands. Joint EP-WXT and Fermi-GBM spectral fitting further shows that the broadband emission can be described by a cutoff power-law model with an additional low-energy spectral break, suggesting a common origin for the single-pulse X-ray and gamma-ray emission. The resulting properties place the event within the Type I GRB region in the $E_{\rm p,z}$-$E_{\rm iso}$ plane, supporting its classification as a compact object merger event. Unlike previously known merger-driven Type I EFXTs with long-lasting X-ray emission, EP260411a reveals that the Type I EFXT population can also extend to the short timescale of a few seconds. Its combination of short duration and hard spectrum occupies a sparsely explored region of the EFXT parameter space, providing a new observational link between short-duration EFXTs and compact object mergers.

astro-ph.HE↗

Jet energetics and remnant magnetism in short gamma-ray bursts from binary neutron-star mergers: A statistical study via broadband afterglow modeling

Short gamma-ray bursts (sGRBs) are believed to originate from compact binary mergers, particularly binary neutron star (BNS) mergers, providing a probe of jet energetics and merger remnants. We compile broadband afterglow observations of 40 sGRBs and perform forward-shock modeling with off-axis Gaussian jets, excluding data potentially affected by additional energy injection. We derive distributions of beaming-corrected jet kinetic energy $E_k$ and radiative efficiency $η_γ$, and combine these with binary population synthesis and numerical simulations to infer remnant black hole (BH) magnetic fields assuming the Blandford-Znajek (BZ) jet-launching mechanism. For the 15 strictly constrained bursts, we find a median $E_k\simeq3.8\times10^{49}$ erg and $η_γ\simeq0.35$, with respective 68% intervals of $[5.1\times10^{48},1.9\times10^{50}]$ erg and [0.09, 0.79]. The inferred magnetic field supplied by the accretion disk and threading the BH horizon is approximately $7\times10^{15}$ G, with a 68% credible interval of $[2.3\times10^{15},2.4\times10^{16}]$ G, depending slightly on the neutron star equation of state. The full sample yields a higher median field of approximately $2\times10^{16}$ G, with the high-energy and high-field tails predominantly contributed by less well-constrained bursts. These results provide statistical constraints on sGRB jet energetics and suggest characteristic BH magnetic fields of order $10^{16}$ G. Comparison with pre-merger neutron star magnetic fields indicates a characteristic amplification factor of $η_B\sim10^3$, providing an observational constraint on magnetic field amplification during BNS mergers and subsequent BH formation.

astro-ph.HE↗

EP250226a: A fast X-ray transient associated with GRB 250226A and its multiwavelength afterglow properties

Recent advances in fast X-ray transient studies have been driven by the wide-field, sensitive soft X-ray monitoring capabilities of the Einstein Probe (EP), enabling the prompt detection and localization of previously underexplored events. EP observations offer new opportunities to investigate the origins, emission mechanisms, and population properties of newly discovered fast X-ray transients. We present multiwavelength observations of EP250226a, an extragalactic fast X-ray transient associated with GRB 250226A. We jointly analyze the prompt emission from soft X-rays to gamma rays and the X-ray afterglow spectra. We collect optical photometric data, perform empirical and afterglow model-based analyses, and present optical-to-infrared spectroscopy, measuring the equivalent widths of absorption lines. The spectroscopic redshift is $z = 3.314$, and the isotropic-equivalent gamma-ray energy is $E_\mathrm{iso}\simeq7.32\times10^{53}$ erg. Its location in the Amati diagram is consistent with a massive-star core-collapse origin (Type II GRB). The fluence ratio $\rm{S}(25-50\,\rm{keV})/\rm{S}(50-100\,\rm{keV})=0.57\pm0.06$ supports its classification as a classical GRB. The X-ray and optical afterglows show achromatic behavior. Among the models considered, a top-hat jet propagating into a uniform interstellar medium best describes the multiwavelength afterglow. This model suggests a highly collimated, nearly on-axis jet, with an isotropic-equivalent kinetic energy of $E_\mathrm{k,iso}\simeq4.07\times10^{55}$ erg, a gamma-ray radiative efficiency of $η_γ\simeq 1.77\%$, and a low magnetic-field energy fraction of $\log ε_\mathrm{B,FS} \simeq -6.52$. EP250226a exhibits typical long-duration GRB properties, with the first soft X-ray peak coinciding with the gamma-ray prompt emission, while the soft X-ray emission lasts significantly longer than the gamma-ray emission.

astro-ph.HE↗

GHA-SmellFix: Taking Action with Agentic LLMs for Detecting and Refactoring GitHub Actions Workflow Smells

Continuous integration and continuous delivery workflows are key artifacts in software projects. In GitHub Actions, they encode build, test, release, deployment, and security automation in YAML. These workflows contain configuration smells affecting security, reliability, maintainability, or operational stability. Existing approaches are mostly rule-based, with rules hard to create and evolve, and typically report findings without fixes. Agentic LLM pipelines can combine contextual detection, transformation selection, and patch generation. Specialized agents can gate refactoring on positive detection verdicts, potentially avoiding unnecessary changes, but it is unclear whether decomposition improves effectiveness or mainly changes overhead. We present GHA-SmellFix, an agentic LLM pipeline for detecting and refactoring GitHub Actions workflow smells. We compare two designs: Joint, where one agent detects and refactors, and Decomposed, where separate agents detect and then refactor. We operationalize 19 smells from an existing catalog with explicit detection criteria, refactoring expectations, exclusion rules, and safety checks, and curate a ground truth of 1,710 (workflow, smell) pairs. We evaluate the designs with four LLMs (GPT-5.4-nano, Gemini 3.5 Flash, Claude Haiku 4.5, and DeepSeek V4 Flash) on 570 sampled pairs. Results show that decomposition does not universally improve patch quality; its main benefit is controlling when patch generation is attempted. It helps models prone to missing smells and can reduce overhead by gating patches. Once a smell is correctly detected, clean refactoring is generally effective, making detection the main end-to-end bottleneck. However, false positives can trigger unnecessary edits to execution-relevant constructs. Practical CI/CD agents thus need reliable abstention and construct-aware validation alongside patch generation.

cs.SE↗

From GPU to TPU with Coding Agents: What Works, What Fails, and What It Costs?

A coding agent can migrate a machine learning workload, report success, and still change how the model trains. Rising compute costs, limited accelerator capacity, and vendor dependence are pushing organizations toward alternatives to graphics processing units (GPUs); a key question is whether agent-generated migrations to tensor processing units (TPUs) can be trusted and at what cost. We build a dataset of 148 PyTorch ML research projects and use Claude Code to migrate ten of them from NVIDIA GPUs to Google Cloud TPUs. We independently assess whether each migration runs, preserves numerical behavior, executes on the intended hardware, maintains the project's goal, and delivers acceptable performance. We also examine failures, human effort, and costs. Eight projects meet our project-goal criterion, and migrations require 2.4 human interventions on average. Of 70 execution attempts, 53 fail (76%), and 26 of these failures (49%) raise no error. The most frequent cause is repeated compilation and other execution inefficiencies, while interactions with third-party libraries can silently change the computation: in one four-chip migration, the agent reports success despite a change in gradient clipping that reduces accuracy from 86.53% to 84.89%. Execution costs vary widely: in one workload, TorchTPU, a PyTorch execution backend for TPUs, trains 1.86 times faster and 25% cheaper per run than the GPU. For practitioners, these findings motivate independent reference runs, verification under the intended hardware configuration, and workload-specific acceptance and stopping criteria that account for both computational and human costs.

cs.SE↗

EP251129a: A Fast X-ray Transient with Two X-Ray Plateaus and Its Off-axis Afterglow

Extragalactic fast X-ray transients (EFXTs) detected by the Einstein Probe are extending the parameter space of relativistic stellar explosions toward softer and longer-lived transients. Here we report EP251129a/GRB 251129A at z=0.505, which exhibits two X-ray plateaus: an early plateau lasting $\sim 10^{4}\,\rm s$ followed by a rapid decay with spectral softening, and a second plateau extending to 60 days, placing it at the extreme long-duration end of Gamma Ray Burst (GRB) plateaus. The early optical emission evolves independently of the X-ray, indicating a different origin; whereas the unusual radio afterglow shows a rapid rise of $F_ν\propto t^{1.9-2.5}$ and a delayed peak at $\sim36-40$ days, providing strong evidence for an off-axis geometry. We find that the early X-ray behavior resembles those of ultra-long GRBs (ULGRBs) and can be naturally explained by the internal dissipation from a newborn millisecond magnetar undergoing gravitational-wave-dominated spin-down before collapsing into a black hole. The early optical, radio and late X-ray emission are well described by an off-axis two-component jet afterglow with additional energy injection, possibly powered by fallback accretion onto black hole. EP251129a therefore connects the emerging EFXT population with ULGRB-like central-engine activity and off-axis afterglow, offering a rare opportunity to probe both the evolution of central engine and jet structure in a single event.

astro-ph.HE↗

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↗

The (missing) gamma-ray counterparts to EP events

While the connection of Fast X-ray Transients (FXTs) detected by Einstein Probe (EP) with Gamma-ray Bursts (GRBs) is increasingly compelling, most lack gamma-ray counterparts, leaving their relation to GRBs unclear. We performed a systematic search for gamma-ray counterparts to the 72 transients detected by EP in its first year, using targeted searches in Fermi/GBM and Fermi/LAT data, complemented by SVOM/GRM, SVOM/ECLAIRs, Swift/BAT and Konus-Wind. For the visible events without a gamma-ray counterpart, we derived simultaneous $3σ$ flux upper limits in the 10-1000 keV and the 0.1-1 GeV band. We find that 23 events (32%) have a gamma-ray counterpart (seven sub-threshold), while 49 events (68%) have none, despite most being visible. For events with a gamma-ray counterpart, the X-ray flux over the gamma-ray $T_{\rm 90}$ is systematically higher than over the full X-ray duration, with flux ratios $1 \lesssim F_{\rm [10-1000\,keV]}/F_{\rm [0.5-4\,keV]} \lesssim 100$, suggesting that gamma-rays are preferentially detected during the brightest X-ray phases. For events without gamma-ray counterpart, the most stringent Fermi/GBM upper limits imply $E_{\rm peak} \lesssim 30$-100 keV and, for the 14 events with measured redshifts, $L_{\rm iso}\lesssim 10^{48}-9\times10^{51}$ erg/s. If classical GRB correlations hold in this regime, these lower energetics imply lower bulk Lorentz factors ($Γ_0 \lesssim 100$), as confirmed in a few cases by afterglow constraints. No significant GeV emission was detected by Fermi/LAT, yielding $1 \lesssim F_{0.1-1\,{\rm GeV}}/F_{0.5-4\,{\rm keV}} \lesssim 10$, placing the first constraints on a potential synchrotron self-Compton component for this new population. Although individual origins remain uncertain, many EP FXTs could be compatible with the GRB population, extending it toward lower $E_{\rm peak}$, luminosities, and bulk Lorentz factors.

astro-ph.HE↗

REATS: LLM Reasoning-based Ensemble Learning for Adaptive Time Series Forecasting

Due to the diversity of real-world time series, no single forecasting model consistently dominates across all samples. Ensemble learning addresses this by combining complementary model strengths, yet existing methods rely on fixed rules or black-box models based solely on numerical inputs, failing to leverage LLM reasoning for interpretable weighting decisions. We propose REATS, which leverages LLM reasoning capabilities as an intelligent ensemble router that jointly processes textual temporal pattern descriptions and numerical features to produce interpretable, sample-adaptive ensemble weights through chain-of-thought reasoning. To enable effective LLM-based ensembling, we study its key design choices and propose: (i) a structured input pipeline that transforms raw time series into hybrid textual--numerical representations with fixed token cost, enabling rule-based chain-of-thought construction without API dependency, augmented with retrieved similar-sample priors; (ii) a diverse multi-row weight supervision scheme coupled with a token-efficient percentage-table format that reduces numerical complexity and mitigates LLM hallucinations; and (iii) a two-stage fine-tuning framework combining SFT with GRPO, where a reciprocal reward mapping transforms the continuous unbounded MSE gap into bounded signals with amplified near-oracle sensitivity, addressing the uniform sensitivity and outlier-dominated advantage compression inherent in naive reward designs for regression-based GRPO. Experiments on eight benchmarks demonstrate that REATS outperforms competitive ensemble baselines while providing natural language explanations and demonstrating strong transfer learning and out-of-domain generalization to unseen candidate models.

cs.LG↗

OPDArena: Understanding Learning and Forgetting in On-Policy Distillation

On-policy distillation (OPD) is increasingly used for language model post-training, yet how teacher supervision shapes learning and forgetting remains unclear. We present OPDArena, a framework comparing supervised fine-tuning (SFT), reinforcement learning with verifiable rewards (RLVR), and OPD across five pretrained models and diverse teacher sources. It jointly evaluates mathematical learning, general capability retention, and predictive distribution changes. Teacher choice strongly shapes retention: students of RLVR-trained teachers improve on the target task while retaining prior capabilities, whereas students of SFT-trained teachers incur greater capability loss. Across post-training methods, out-of-domain (OOD) distribution change shows a more consistent positive association with forgetting than in-domain change. To understand how teacher choice affects these changes, we examine the additional information teachers provide relative to the student's pretrained model. Controlled teacher comparisons show that the task-specific preferences teachers acquire through post-training make student updates more concentrated in-domain.

cs.LG↗

Multi-wavelength study of EP250416a / GRB 250416C: An Optically Dark Long GRB with a Late Jet Break

We present multi-wavelength study of the $γ$/X-ray transient EP250416a (also designated GRB 250416C), triggered by the Einstein Probe (EP) Wide-field X-ray Telescope and also by SVOM and Konus-Wind (KW). Observations spanning the $γ$-ray, X-ray, and optical bands facilitated detailed analysis of the burst's prompt emission, afterglow evolution, and physical origin. GRB 250416C exhibits a burst duration of 30 s in X-ray and 17.7 s in $γ$-rays, with joint spectral fitting of 0.5-5000 keV data gives $E\rm_{peak}=342_{-232}^{+90}$ keV. Optical spectroscopy of the afterglow, acquired with the Gemini Multi-Object Spectrograph (GMOS) on Gemini South, yielded a redshift of $z=0.963$. Accounting for the measured redshift, the isotropic energies are $E\rm_{X,iso}=2.7_{-0.5}^{+0.9}\times10^{50}$ erg and $E\rm_{γ,iso}=7.34_{-2.1}^{+5.1}\times10^{51}$ erg, aligning with the Amati relation for long GRBs. The fluence ratio $\rm S(25-50~keV)/S(50-100~keV)=0.78_{-0.12}^{+0.10}$ classifies GRB 250416C as an X-ray rich (XRR) GRB. The X-ray afterglow shows an initial shallow decay ($α\approx -0.5$) transitioning to a canonical decay phase ($α\approx -1$), with a very late jet break at $t\sim 1.5\times 10^6$ s, corresponding to a jet half-opening angle of $θ_j=10.6_{-1.8}^{+1.9}$ degrees. GRB 250416C is optically dark, as it shows only a faint $r$-band detection ($r=24.16\pm 0.13$ mag) from Gemini South-GMOS and a low optical-to-X-ray spectral index $β_{\rm OX} = 0.3$. This may be attributed to significant host-galaxy extinction, with a required $A_V^{\text{host}}=2.7\pm 0.3\ \text{mag}$ derived from the extinction curve model.

astro-ph.HE↗

ReDrive: Shaping Representations with World Modeling for End-to-End Driving

Driving policies require capabilities of scene understanding and future evolution prediction. To achieve this goal, current end-to-end models typically construct complex perception-planning pipelines or introduce world models that explicitly predict future states, resulting in a complex system architecture. Inspired by the transferability of general-purpose visual representations, we argue that combining sufficiently strong visual representations with representation world modeling can support effective planning without relying on complex inference-time auxiliary modules. Based on this insight, we present ReDrive, an end-to-end driving framework that strengthens planning-oriented visual features via future representation prediction. To achieve this, ReDrive adopts a three-stage training pipeline consisting of driving video pretraining, joint world-modeling and planning training, and planner adaptation. This yields a strong planning-oriented representation and a high-performance planner, while requiring neither auxiliary perception modules nor future prediction at inference time. Experiments on NAVSIM demonstrate strong performance, achieving 91.0 PDMS on NAVSIM v1 and 90.8 EPDMS on NAVSIM v2. These results show that shaping representations with world modeling is sufficient to enable high-performance end-to-end planning while retaining a simple encoder-planner inference pipeline.

cs.CV↗

EP250302a: violent shell collision in a soft-X-ray-selected GRB-like transient

The Einstein Probe opens a previously unexplored soft X-ray window onto gamma-ray bursts, filling a critical observational gap in the soft X-ray coverage of their prompt emission. In this letter, we present EP250302a, a soft-X-ray-selected, GRB-like transient at $z=1.131$ detected by the Einstein Probe. Follow-up observations from X-ray to radio reveal a narrow X-ray flare at $\sim 1.1$\, ks and subsequent achromatic optical and X-ray rebrightening. These features challenge a standard single-component afterglow model and indicate the need for multiple ejecta components. A violent collision between a late relativistic shell and the decelerated leading blast wave provides a plausible interpretation: the flare arises from internal dissipation of the late ejecta, while the rebrightening is powered by the shocked emission produced in the collision. Quantitative modeling constrains the kinetic energy ratio between the late shell and the initial ejecta to $E_{\rm k,iso,2}/E_{\rm k,iso,1} \sim 5$ (with $E_{\rm k,iso,2} \sim 10^{53}$~erg and $E_{\rm k,iso,1} \sim 2\times10^{52}$~erg), as well as the Lorentz factor contrast to $Γ_{2,0}/Γ_{1,0} \approx 0.98$--$2.27$, required to reproduce the observed flare luminosity and rebrightening amplitude. Such an energetic late shell can be launched in a radiatively inefficient second episode of central-engine activity. Thanks to the well-sampled, early-time multiband coverage facilitated by the EP trigger, EP250302a provides a valuable case to test the physical connection between central-engine activity and shell collisions.

astro-ph.HE↗

CIT-CAD: Constraint Intent Tree-based CAD Code Generation and Verification

Natural-language Computer-Aided Design (CAD) code generation aims to turn design intent into executable and editable parametric programs. Large language models (LLMs) make this goal increasingly practical, but useful systems must preserve the construction process behind the rendered geometry. Existing benchmarks and methods mostly focus on how closely the generated CAD model matches the reference geometry, often using metrics such as Intersection over Union (IoU). Such metrics can miss errors in part decomposition, construction hierarchy, Boolean operations, sketch structure, and geometric relations. This gap calls for a representation that makes design intent explicit and lets a system check generated code against that intent. We propose CIT-CAD, a framework that infers a Constraint Intent Tree (CIT) from the input description to represent the intended entities, hierarchy, operations, and relations. The tree has two roles: it guides CAD code generation and defines expected constraints for verification. The framework extracts actual constraints from the generated program, compares them with the expected constraints, and uses mismatches to localize and repair design violations. Experiments show that the framework improves CAD generation performance, with larger gains on more complex multi-entity designs. By turning design intent into an explicit and checkable object, this work is the first attempt to move text-to-CAD generation beyond rendered-geometry matching toward construction-aware synthesis, verification, and repair.

cs.AI↗

A Sample-Wise Adjoint Regression Framework for Mean-Field Control with Connections to Adjoint Matching

This work proposes a novel numerical approach for solving mean-field control (MFC) problems using an adjoint-based optimization framework motivated by the stochastic maximum principle (SMP). Rather than solving the adjoint processes $(Y_t,Z_t)$ explicitly, we construct sample-wise unbiased estimators of their discretized counterparts and use them to approximate the Hamiltonian control gradient through recursive regression. The control is then updated by a gradient-descent scheme. This approach differs from conventional deep-learning methods, which typically follow a ``discretize-then-optimize'' paradigm and directly optimize a globally parameterized control through the discretized objective. Numerical experiments demonstrate competitive, and in many cases improved performance compared with direct deep-learning approaches. The sample-wise and regression-based structure also supports scalable implementation in high-dimensional settings and makes the method attractive for generative modeling problems involving particle-based representations and distributional objectives. On the theoretical side, we establish a connection between a particular class of MFC problems and the \emph{adjoint matching} framework. Using the SMP under the mean field control setting, we further show that the self-consistent critical point of the resulting mean-field adjoint matching loss coincides with the optimal control.

math.OC↗

Evaluating Language Models on Cross-Language Code Functional Equivalence

Background: Large Language Models (LLMs) have demonstrated strong performance across a variety of code-understanding tasks, leading many to believe that they can reason about program semantics. However, existing evaluations primarily focus on single-language settings or rely on synthetically generated code, raising concerns about whether current results reflect true semantic understanding. Aims: We investigate whether LLMs can accurately judge functional equivalence across different programming languages in human-written code, a setting that requires deeper reasoning beyond superficial similarity. Method: We introduce PolyHuman, a dataset of human-written programs in CPP, Java, and Python. Using this dataset, we evaluate intra- and inter-language equivalence detection across open-weight and proprietary LLMs, selecting GPT-o4-mini as a representative model to assess stability. We then manually analyze 81 cases of systematic disagreement in which models incorrectly judge functional equivalence, examining the code logic and the generated Chain-of-Thought reasoning. Finally, we categorize these failures and compare them across GPT-o4-mini, Claude-Opus-4.7, and Gemini-3-Flash to determine whether they reflect model-specific issues or broader limitations of state-of-the-art LLMs. Results: We identify a difficulty-dependent breakdown in equivalence judgment (harder problems make the model increasingly prone to misclassifying non-equivalent code as equivalent), a model-specific sensitivity to programming language for the best-performing model (particularly a more conservative behavior on Python), and a partial reliance on similarity-based cues. GPT-o4-mini also shows substantial run-to-run instability under identical settings, indicating inconsistent rather than absent capability. Conclusions: Current LLMs do not reliably capture functional equivalence within or across languages.

cs.SE↗