Searcharxiv⌕ Search

arXiv subjects

Xiaohu Yang

Publications and source records attributed to Xiaohu Yang.

At least 55 records · Page 3Linked to original sources

Every Maintenance Has Its Exemplar: The Future of Software Maintenance through Migration

Maintenance is a critical stage in the software lifecycle, ensuring that post-release systems remain reliable, efficient, and adaptable. However, manual software maintenance is labor-intensive, time-consuming, and error-prone, which highlights the urgent need for automation. Learning from maintenance activities conducted on other software systems offers an effective way to improve efficiency. In particular, recent research has demonstrated that migration-based approaches transfer knowledge, artifacts, or solutions from one system to another and show strong potential in tasks such as API evolution adaptation, software testing, and migrating patches for fault correction. This makes migration-based maintenance a valuable research direction for advancing automated maintenance. This paper takes a step further by presenting the first systematic research agenda on migration-based approaches to software maintenance. We characterize the migration-based maintenance lifecycle through four key stages: \ding{182} identifying a maintenance task that can be addressed through migration, \ding{183} selecting suitable migration sources for the target project,\ding{184} matching relevant data across systems and adapting the migrated data to the target context, and \ding{185} validating the correctness of the migration. We also analyze the challenges that may arise at each stage. Our goal is to encourage the community to explore migration-based approaches more thoroughly and to tackle the key challenges that must be solved to advance automated software maintenance.

cs.SE↗

Field Matters: A Lightweight LLM-enhanced Method for CTR Prediction

Click-through rate (CTR) prediction is a fundamental task in modern recommender systems. In recent years, the integration of large language models (LLMs) has been shown to effectively enhance the performance of traditional CTR methods. However, existing LLM-enhanced methods often require extensive processing of detailed textual descriptions for large-scale instances or user/item entities, leading to substantial computational overhead. To address this challenge, this work introduces LLaCTR, a novel and lightweight LLM-enhanced CTR method that employs a field-level enhancement paradigm. Specifically, LLaCTR first utilizes LLMs to distill crucial and lightweight semantic knowledge from small-scale feature fields through self-supervised field-feature fine-tuning. Subsequently, it leverages this field-level semantic knowledge to enhance both feature representation and feature interactions. In our experiments, we integrate LLaCTR with six representative CTR models across four datasets, demonstrating its superior performance in terms of both effectiveness and efficiency compared to existing LLM-enhanced methods. Our code is available at https://github.com/istarryn/LLaCTR.

cs.IR↗

Understanding and Preserving Safety in Fine-Tuned LLMs

Fine-tuning is an essential and pervasive functionality for applying large language models (LLMs) to downstream tasks. However, it has the potential to substantially degrade safety alignment, e.g., by greatly increasing susceptibility to jailbreak attacks, even when the fine-tuning data is entirely harmless. Despite garnering growing attention in defense efforts during the fine-tuning stage, existing methods struggle with a persistent safety-utility dilemma: emphasizing safety compromises task performance, whereas prioritizing utility typically requires deep fine-tuning that inevitably leads to steep safety declination. In this work, we address this dilemma by shedding new light on the geometric interaction between safety- and utility-oriented gradients in safety-aligned LLMs. Through systematic empirical analysis, we uncover three key insights: (I) safety gradients lie in a low-rank subspace, while utility gradients span a broader high-dimensional space; (II) these subspaces are often negatively correlated, causing directional conflicts during fine-tuning; and (III) the dominant safety direction can be efficiently estimated from a single sample. Building upon these novel insights, we propose safety-preserving fine-tuning (SPF), a lightweight approach that explicitly removes gradient components conflicting with the low-rank safety subspace. Theoretically, we show that SPF guarantees utility convergence while bounding safety drift. Empirically, SPF consistently maintains downstream task performance and recovers nearly all pre-trained safety alignment, even under adversarial fine-tuning scenarios. Furthermore, SPF exhibits robust resistance to both deep fine-tuning and dynamic jailbreak attacks. Together, our findings provide new mechanistic understanding and practical guidance toward always-aligned LLM fine-tuning.

cs.LG↗

DepRadar: Agentic Coordination for Context Aware Defect Impact Analysis in Deep Learning Libraries

Deep learning libraries like Transformers and Megatron are now widely adopted in modern AI programs. However, when these libraries introduce defects, ranging from silent computation errors to subtle performance regressions, it is often challenging for downstream users to assess whether their own programs are affected. Such impact analysis requires not only understanding the defect semantics but also checking whether the client code satisfies complex triggering conditions involving configuration flags, runtime environments, and indirect API usage. We present DepRadar, an agent coordination framework for fine grained defect and impact analysis in DL library updates. DepRadar coordinates four specialized agents across three steps: 1. the PR Miner and Code Diff Analyzer extract structured defect semantics from commits or pull requests, 2. the Orchestrator Agent synthesizes these signals into a unified defect pattern with trigger conditions, and 3. the Impact Analyzer checks downstream programs to determine whether the defect can be triggered. To improve accuracy and explainability, DepRadar integrates static analysis with DL-specific domain rules for defect reasoning and client side tracing. We evaluate DepRadar on 157 PRs and 70 commits across two representative DL libraries. It achieves 90% precision in defect identification and generates high quality structured fields (average field score 1.6). On 122 client programs, DepRadar identifies affected cases with 90% recall and 80% precision, substantially outperforming other baselines.

cs.SE↗

SolContractEval: A Benchmark for Evaluating Contract-Level Solidity Code Generation

The rise of blockchain has brought smart contracts into mainstream use, creating a demand for smart contract generation tools. While large language models (LLMs) excel at generating code in general-purpose languages, their effectiveness on Solidity, the primary language for smart contracts, remains underexplored. Solidity constitutes only a small portion of typical LLM training data and differs from general-purpose languages in its version-sensitive syntax and limited flexibility. These factors raise concerns about the reliability of existing LLMs for Solidity code generation. Critically, existing evaluations, focused on isolated functions and synthetic inputs, fall short of assessing models' capabilities in real-world contract development. To bridge this gap, we introduce SolContractEval, the first contract-level benchmark for Solidity code generation. It comprises 124 tasks drawn from real on-chain contracts across nine major domains. Each task input, consisting of complete context dependencies, a structured contract framework, and a concise task prompt, is independently annotated and cross-validated by experienced developers. To enable precise and automated evaluation of functional correctness, we also develop a dynamic evaluation framework based on historical transaction replay. Building on SolContractEval, we perform a systematic evaluation of six mainstream LLMs. We find that Claude-3.7-Sonnet achieves the highest overall performance, though evaluated models underperform relative to their capabilities on class-level generation tasks in general-purpose programming languages. Second, current models perform better on tasks that follow standard patterns but struggle with complex logic and inter-contract dependencies. Finally, they exhibit limited understanding of Solidity-specific features and contextual dependencies.

cs.SE↗

Safety at One Shot: Patching Fine-Tuned LLMs with A Single Instance

Fine-tuning safety-aligned large language models (LLMs) can substantially compromise their safety. Previous approaches require many safety samples or calibration sets, which not only incur significant computational overhead during realignment but also lead to noticeable degradation in model utility. Contrary to this belief, we show that safety alignment can be fully recovered with only a single safety example, without sacrificing utility and at minimal cost. Remarkably, this recovery is effective regardless of the number of harmful examples used in fine-tuning or the size of the underlying model, and convergence is achieved within just a few epochs. Furthermore, we uncover the low-rank structure of the safety gradient, which explains why such efficient correction is possible. We validate our findings across five safety-aligned LLMs and multiple datasets, demonstrating the generality of our approach.

cs.LG↗

Why Is My Transaction Risky? Understanding Smart Contract Semantics and Interactions in the NFT Ecosystem

The NFT ecosystem represents an interconnected, decentralized environment that encompasses the creation, distribution, and trading of Non-Fungible Tokens (NFTs), where key actors, such as marketplaces, sellers, and buyers, utilize smart contracts to facilitate secure, transparent, and trustless transactions. Scam tokens are deliberately created to mislead users and facilitate financial exploitation, posing significant risks in the NFT ecosystem. Prior work has explored the NFT ecosystem from various perspectives, including security challenges, actor behaviors, and risks from scams and wash trading, leaving a gap in understanding the semantics and interactions of smart contracts during transactions, and how the risks associated with scam tokens manifest in relation to the semantics and interactions of contracts. To bridge this gap, we conducted a large-scale empirical study on smart contract semantics and interactions in the NFT ecosystem, using a curated dataset of nearly 100 million transactions across 20 million blocks on Ethereum. We observe a limited semantic diversity among smart contracts in the NFT ecosystem, dominated by proxy, token, and DeFi contracts. Marketplace and proxy registry contracts are the most frequently involved in smart contract interactions during transactions, engaging with a broad spectrum of contracts in the ecosystem. Token contracts exhibit bytecode-level diversity, whereas scam tokens exhibit bytecode convergence. Certain interaction patterns between smart contracts are common to both risky and non-risky transactions, while others are predominantly associated with risky transactions. Based on our findings, we provide recommendations to mitigate risks in the blockchain ecosystem, and outline future research directions.

cs.SE↗

CREME: Robustness Enhancement of Code LLMs via Layer-Aware Model Editing

Large language models (LLMs) have demonstrated impressive capabilities in code generation, where the natural language prompt plays a crucial role in conveying user intent to the model. However, prior studies have shown that LLMs are highly sensitive to prompt perturbations. Minor modifications in wording, syntax, or formatting can significantly reduce the functional correctness of generated code. As perturbations frequently occur in real-world scenarios, improving the robustness of LLMs to prompt perturbations is essential for ensuring reliable performance in practical code generation. In this paper, we introduce CREME (Code Robustness Enhancement via Model Editing), a novel approach that enhances LLM robustness through targeted parameter updates. CREME first identifies robustness-sensitive layers by comparing hidden states between an original prompt and its perturbed variant. Then, it performs lightweight parameter editing at the identified layer to reduce performance degradation. We evaluate CREME on two widely used code generation benchmarks (HumanEval and MBPP) along with their perturbed counterparts. Experimental results show that CREME improves Pass@1 accuracy by 63% on perturbed prompts while maintaining stable performance on clean inputs, with accuracy deviations within 1%. Further analysis reveals that robustness-sensitive layers are primarily concentrated in the middle and deeper layers of the network, and their locations vary across different model architectures. These insights provide a valuable foundation for developing future robustness-oriented editing strategies.

cs.SE↗

Learning to Align Human Code Preferences

Large Language Models (LLMs) have demonstrated remarkable potential in automating software development tasks. While recent advances leverage Supervised Fine-Tuning (SFT) and Direct Preference Optimization (DPO) to align models with human preferences, the optimal training strategy remains unclear across diverse code preference scenarios. This paper systematically investigates the roles of SFT and DPO in aligning LLMs with different code preferences. Through both theoretical analysis and empirical observation, we hypothesize that SFT excels in scenarios with objectively verifiable optimal solutions, while applying SFT followed by DPO (S&D) enables models to explore superior solutions in scenarios without objectively verifiable optimal solutions. Based on the analysis and experimental evidence, we propose Adaptive Preference Optimization (APO), a dynamic integration approach that adaptively amplifies preferred responses, suppresses dispreferred ones, and encourages exploration of potentially superior solutions during training. Extensive experiments across six representative code preference tasks validate our theoretical hypotheses and demonstrate that APO consistently matches or surpasses the performance of existing SFT and S&D strategies. Our work provides both theoretical foundations and practical guidance for selecting appropriate training strategies in different code preference alignment scenarios.

cs.SE↗

CATCODER: Repository-Level Code Generation with Relevant Code and Type Context

Large language models (LLMs) have demonstrated remarkable capabilities in code generation tasks. However, repository-level code generation presents unique challenges, particularly due to the need to utilize information spread across multiple files within a repository. Specifically, successful generation depends on a solid grasp of both general, context-agnostic knowledge and specific, context-dependent knowledge. While LLMs are widely used for the context-agnostic aspect, existing retrieval-based approaches sometimes fall short as they are limited in obtaining a broader and deeper repository context. In this paper, we present CatCoder, a novel code generation framework designed for statically typed programming languages. CatCoder enhances repository-level code generation by integrating relevant code and type context. Specifically, it leverages static analyzers to extract type dependencies and merges this information with retrieved code to create comprehensive prompts for LLMs. To evaluate the effectiveness of CatCoder, we adapt and construct benchmarks that include 199 Java tasks and 90 Rust tasks. The results show that CatCoder outperforms the RepoCoder baseline by up to 14.44% and 17.35%, in terms of compile@k and pass@k scores. In addition, the generalizability of CatCoder is assessed using various LLMs, including both code-specialized models and general-purpose models. Our findings indicate consistent performance improvements across all models, which underlines the practicality of CatCoder. Furthermore, we evaluate the time consumption of CatCoder in a large open source repository, and the results demonstrate the scalability of CatCoder.

cs.SE↗

Unveiling the Sources of X-ray Luminosity in DESI Galaxy Groups: Insights from the SRG/eROSITA All-Sky Survey

We use the first eROSITA all-sky survey (eRASS1) to investigate the contributions of AGN and extended gas to the total X-ray luminosity ($L_X$) of galaxy groups with different halo masses ($M_h$) at different redshifts. The presence of AGN in their central galaxies is identified using multi-wavelength catalogs, including the X-ray counterparts, the ASKAP radio catalog, and the DESI spectroscopic measurements. We apply the stacking method to obtain sufficient statistics for the X-ray surface brightness profile and the $L_X$ for groups with different central AGN properties. We find that the X-ray groups exhibit the highest $L_X$, followed by groups with QSO, radio, BPT-AGN, and non-AGN centrals. Moreover, the $L_X$ of the $M_h \lesssim 10^{13}h^{-1}M_\odot$ groups is dominated by the central AGN, while the X-ray emission from extended gas tends to be more prominent in the $M_h \gtrsim 10^{13}h^{-1}M_\odot$ groups. In groups where the AGN play a major role in X-ray emission, the contribution from extended gas is minor, resulting in significant uncertainties concerning the extended X-ray emission. When the subset containing the X-ray detected counterparts is excluded, the extended gas component becomes easier to obtain. A correlation has been identified between the X-ray luminosity of the central AGN and extended gas. However, once we account for the positional offset, their correlation becomes less prominent. Currently, the results are not conclusive enough to confirm whether there is a connection between the AGN feedback and extended gas. However, they provide a new perspective on the feedback processes in the history of group assembly.

astro-ph.GA↗

A semi-analytical mock galaxy catalog for the CSST extragalactic surveys from the Jiutian simulations

We introduce a mock galaxy catalog built for the CSST extragalactic surveys using the primary runs of the Jiutian $N$-body simulation suites. The catalogs are built by coupling the GAlaxy Evolution and Assembly (GAEA) semi-analytical model of galaxy formation with merger trees extracted from the simulations using the Hierarchical Bound-Tracing (HBT+) algorithm. The spectral energy distributions (SEDs) and broadband magnitudes are computed using the neural-network-based stellar population synthesizer StarDuster, which is trained on radiative transfer simulations to account for detailed galaxy geometry in modeling dust obscuration. Galaxy light-cones up to $z=5$ are subsequently generated with the BLiC light-cone builder which interpolates the properties of galaxies over time using an optimized interpolation scheme. The resulting catalogs exhibit good convergence in many statistical properties of the galaxy population produced from two different resolution simulations. The catalogs reproduce a number of observed galaxy properties across a range of galaxy mass and redshift, including the stellar mass functions, the luminosity function, gas mass fraction, galaxy size-mass relation and galaxy clustering. We also present the photometric and redshift distributions of galaxies expected to be observed in the CSST surveys.

astro-ph.GA↗

Search for Past Stellar Encounters and the Origin of 3I/ATLAS

3I/ATLAS, the third discovered interstellar object, has a heliocentric speed of 58 km/s and exhibits cometary activity. To constrain the origin of 3I/ATLAS and its past dynamical evolution, we propagate the orbits of 3I/ATLAS and nearby stars to search for stellar encounters. Integrating orbits in the Galactic potential and propagating the astrometric and radial-velocity uncertainties of 30 million Gaia stars, we identify 25 encounters with median encounter distances less than 1 pc. However, because the encounter speeds between 3I/ATLAS and each encounter exceed 20 km/s, none is a plausible host under common ejection mechanisms. We infer stellar masses for most stars and quantify the gravitational perturbations exerted by each individual star or each binary system on 3I/ATLAS. The strongest gravitational scattering perturber is a wide M-dwarf binary. Among all past encounters, the binary's barycenter and 3I/ATLAS reach the small encounter distance of 0.242 pc and the encounter speed of 28.39 km/s,1.64 Myr ago. We further demonstrate that the cumulative influence of the stellar encounters on both the speed and direction of 3I/ATLAS is weak. Based on the present kinematics of 3I/ATLAS to assess its origin, we find that a thin-disk origin is strongly favored, because the thin disk both exhibits a velocity distribution closely matching that of 3I/ATLAS and provides the dominant local number density of stars.

astro-ph.SR↗

Direct Measurement of Galaxy Assembly Bias using DESI DR1 Data

We report the first direct measurement of galaxy assembly bias, a critical systematic in cosmology, from the Dark Energy Spectroscopic Instrument (DESI) Bright Galaxy Survey. We introduce a novel, cosmology-independent method to measure the halo occupation distribution (HOD) by combining a state-of-the-art group catalog with weak gravitational lensing. For groups binned by total luminosity, we determine the galaxy occupation number $N_{\rm gal}$ from group-galaxy cross-correlations, while weak lensing constrains the average halo mass $M_h$. Applying this to a volume-limited sample at $z{\in}[0.05,0.2]$, we measure the dependence of HOD, $N_{\rm gal}(M_h)$, on large-scale overdensity $δ_{g}$. Focusing on the satellite galaxies, we find an assembly bias parameter of $Q_{\rm sat}{=}0.05{\pm}0.14$, a result consistent with zero and in tension with many empirical galaxy formation models. Our method provides a robust approach for characterizing galaxy assembly bias to achieve precision cosmology with DESI and future Stage-V surveys.

astro-ph.GA↗

DarkAI: Reconstructing the density, velocity and tidal field of dark matter from a DESI-like bright galaxy sample

Reconstructing the mass density, velocity, and tidal (MTV) fields of dark matter from galaxy surveys is essential for advancing our understanding of the LSS of the Universe. In this work, we present a machine learning-based framework using a UNet convolutional neural network to reconstruct the MTV fields from mock samples of the DESI bright galaxy survey within the redshift range $0.1 < z < 0.4$. Our approach accounts for realistic observational effects, including geometric selection, flux-limited data, and redshift space distortion (RSD) effects, thereby improving the fidelity of the reconstructed fields. Testing on mock galaxy catalogs generated from the Jiutian N-body simulation, our method achieves significant accuracy level. The reconstructed density field exhibits strong consistency with the true field, effectively eliminating most RSD effects and achieving a cross-correlation power spectrum coefficient greater than 0.985 on scales with $k < 0.1 \, h \, \mathrm{Mpc}^{-1}$. The velocity field reconstruction accurately captures large-scale coherent flows and small-scale turbulent features, exhibiting slopes of grid-to-grid relationships close to unity and scatter below $\sim$100 $\mathrm{km} \, \mathrm{s}^{-1}$. Additionally, the tidal field is reconstructed without bias, successfully recovering the features of the large-scale cosmic web, including clusters, filaments, sheets, and voids. Our results confirm that the proposed framework effectively captures the large-scale distribution and dynamics of dark matter while addressing key systematic challenges. These advancements provide a reliable and robust tool for analyzing current and future galaxy surveys, paving the way for new insights into cosmic structure formation and evolution.

astro-ph.CO↗

Evolution of the Physical Properties of the Most Massive Galaxies in Clusters and their Protohalos

We investigated the evolution of the physical properties of the brightest galaxies in clusters and their protohalos from $z = 4$ to $z = 0$. Galaxy clusters and groups are identified using a halo-based group finder applied to the COSMOS2020 galaxy catalog. We construct evolution chains from low redshift clusters to higher redshift groups via the abundance matching method. The region of protohalos corresponding to clusters is defined on the basis of a characteristic radius. Our analysis encompasses a wide range of physical properties, including stellar mass, luminosity, star formation rate (SFR), specific star formation rate (sSFR), color ($g - r$), and stellar age. The evolution trends of the most massive galaxies (MMGs) in higher redshift groups and their corresponding protohalos are generally consistent. The stellar mass of MMGs shows an increasing trend across the entire redshift range. By considering the stellar mass growth as in-situ and ex-situ components, we find that in-situ star formation is efficient at $z \sim 2$, while ex-situ accretion becomes the primary growth channel at later times. At $z \gtrsim 2$, MMGs undergo an intense star formation phase of approximately $10^{2}\ \rm M_{\odot}yr^{-1}$, but are generally quenched at lower redshifts. Stellar age analysis suggests that most stars in MMGs formed at $z > 2$. Our results present a coherent picture of MMG evolution across cosmic epochs, which is broadly consistent with the current theoretical framework of galaxy formation and evolution. Moreover, our work provides an intriguing way to trace galaxy evolution through the construction of cluster evolutionary chains in observations.

astro-ph.GA↗

An Empirical Study of Vulnerable Package Dependencies in LLM Repositories

Large language models (LLMs) have developed rapidly in recent years, revolutionizing various fields. Despite their widespread success, LLMs heavily rely on external code dependencies from package management systems, creating a complex and interconnected LLM dependency supply chain. Vulnerabilities in dependencies can expose LLMs to security risks. While existing research predominantly focuses on model-level security threats, vulnerabilities within the LLM dependency supply chain have been overlooked. To fill this gap, we conducted an empirical analysis of 52 open-source LLMs, examining their third-party dependencies and associated vulnerabilities. We then explored activities within the LLM repositories to understand how maintainers manage third-party vulnerabilities in practice. Finally, we compared third-party dependency vulnerabilities in the LLM ecosystem to those in the Python ecosystem. Our results show that half of the vulnerabilities in the LLM ecosystem remain undisclosed for more than 56.2 months, significantly longer than those in the Python ecosystem. Additionally, 75.8% of LLMs include vulnerable dependencies in their configuration files. This study advances the understanding of LLM supply chain risks, provides insights for practitioners, and highlights potential directions for improving the security of the LLM supply chain.

cs.CR↗

Dependence of halo properties on central-satellite magnitude gaps through weak lensing measurements

The magnitude gap between the central and satellite galaxies encodes information about the mass accretion history of a dark matter halo, and serves as a useful observational probe for the mass distribution in a halo. In this work, we perform the first weak lensing test of the connections between the magnitude gap and the halo profile. We measure the halo profiles of isolated central galaxies (ICGs) selected primarily from the SDSS Main Galaxy Sample. Halo mass and concentration are inferred by fitting stacked lensing profiles in bins of central luminosity, $L_\mathrm{c}$, and the central-satellite magnitude gap, $L_\mathrm{gap}$. We detect dependence on the magnitude gap in both halo properties. The dependence is the strongest in the ICG luminosity range of $10^{10.3}<L_\mathrm{c}[h^{-2}L_\odot]\leq 10^{10.7}$, where halos with smaller gaps have higher masses and lower concentrations. When $10^{10.7} <L_c[h^{-2}L_\odot] \leq 10^{11.1}$, however, no significant gap dependence is detected. In the range of $10^{9.9}<L_\mathrm{c}[h^{-2}L_\odot] \leq 10^{10.3}$, a disordering of the gap dependence is marginally observable. We compare the observational results with predictions by two lightcone catalogs built from the Illustris TNG300 and the Millennium simulations. The gap dependence in the two mock samples show overall consistency with observations, but neither matches them in all $L_\mathrm{c}$ bins to a quantitative level. We also compare the significance of the gap dependence on halo mass and concentration and find that our measurement prefers gap dependence in both parameters, while the halo mass dependence is preferred over the concentration if only one of the two dependencies is allowed.

astro-ph.CO↗