Search arXiv⌕ Search

arXiv subjects

Dan Li

Publications and source records attributed to Dan Li.

At least 73 records · Page 4Linked to original sources

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↗

Manipulating Anomalous Transport via Crystal Symmetry in 2D Altermagnets

Anomalous transports, including the anomalous Hall effect (AHE) and anomalous Nernst effect (ANE), are typical manifestations of time-reversal-symmetry-breaking responses in materials. In general, the two Hall states with opposite Hall conductivities can be regarded as time-reversal pairs coupled to magnetic order, and switching between them relies on reversing the magnetization via an external magnetic field or electric current. Here, we introduce a approach for manipulating anomalous transport through crystal symmetry engineering in two-dimensional (2D) altermagnetic systems. Based on symmetry analysis, we demonstrate that 2D altermagnets (AM) with out-of-plane Néel vectors will not host any anomalous Hall transport. Remarkably, breaking the symmetry connecting the two magnetic sublattices, an anomalous Hall response can emerge immediately, and the signs of the anomalous Hall and anomalous Nernst conductivities can be flexibly controlled by the symmetry-breaking term, thereby realizing tunable sign-reversible anomalous transport. Furthermore, the feasibility of the theoretical scheme is further verified by explicit lattice-model construction. Using first-principles calculations, we investigate the realization of crystal symmetry-controlled anomalous transport in a 2D AM material Cr$_{2}$O$_{2}$. The results indicate that Cr$_{2}$O$_{2}$ with out-of-plane Néel vectors can sequentially exhibit the AHE and quantum anomalous Hall effect (QAHE) under continuous uniaxial strain. Interestingly, the sign reversal between these two effects can be achieved by simply rotating the strain direction by C$_{4z}$ symmetry. The corresponding ANE and its sign reversal are also revealed. Our findings provide a new strategy to manipulate anomalous transport, and should have significant potential applications.

cond-mat.mes-hall↗

Effect of superconductivity by Nb and V substitution in kagome CaPd5

Materials featuring kagome lattices have attracted significant research interest due to their unique geometric frustration, which gives rise to rich physical phenomena such as non-trivial topology, spin fluctuations, and superconductivity. In this work, using CaPd5 as the prototype structure, we discover and systematically investigate a new class of kagome superconductors, CaMxPd5-x (M = Nb and V) alloys. First-principles calculations confirm that these compounds are non-magnetic metals, among which four are dynamically stable: CaNb5, CaV5, CaNb2Pd3, and CaV2Pd3. CaNb5 is identified as a strong electron-phonon coupling (EPC) superconductor with the highest superconducting transition temperature (Tc) of 10.1 K, which can be further increased to 12.8 K under external pressure. In contrast, CaV5, CaNb2Pd3, and CaV2Pd3 exhibit weaker EPC and correspondingly lower Tc values. Furthermore, by applying the method of symmetry indicators, we systematically classify the topological and nodal characteristics of CaNb5, providing valuable insights for determining its superconducting pairing symmetry. Our findings demonstrate that Nb and V substitution in kagome CaPd5 provides an effective route for designing a new type of kagome superconductor with relatively high Tc. This study also offers new perspectives on topological superconductivity in kagome systems and establishes a useful guideline for discovering other superconducting materials with unique properties.

cond-mat.supr-con↗

Switchable Giant Spin Injection Current in Janus Altermagnet Fe$_2$SSeO

Generating and controlling spin current in miniaturized magnetic quantum devices remains a central objective of spintronics, due to its potential to enable future energy-efficient information technologies. Among the existing magnetic phases, altermagnetism have recently emerged as a highly promising platform for spin current generation and control, going beyond ferromagnetism and antiferromagnetism. Here, we propose a symmetry-allowed spin photovoltaic effect in two-dimensional (2D) altermagnetic semiconductors that enables predictable control of giant spin injection currents. Distinct from parity-time ($\mathcal{PT}$)-antiferromagnets, Janus altermagnetic semiconductors generate not only shift current but also a unique injection current with spin momentum locked in a specific direction under linearly polarized light -- a mechanism absent in $\mathcal{PT}$-antiferromagnets. Through symmetry analysis and first-principles calculations, we identify Janus Fe$_2$SSeO as a promising candidate. Specifically, the monolayer Fe$_2$SSeO exhibits a polarization-dependent injection conductivity reaching $\sim$1,200~$μ$A/V$^{2}\!\cdot\!\hbar/2e$, and the giant spin injection current can be effectively switched by rotating the magnetization direction and engineering strains. These findings underscore the potential of 2D altermagnets in spin photovoltaics and open avenues for innovative quantum devices.

cond-mat.mtrl-sci↗

FBA$^2$D: Frequency-based Black-box Attack for AI-generated Image Detection

The prosperous development of Artificial Intelligence-Generated Content (AIGC) has brought people's anxiety about the spread of false information on social media. Designing detectors for filtering is an effective defense method, but most detectors will be compromised by adversarial samples. Currently, most studies exposing AIGC security issues assume information on model structure and data distribution. In real applications, attackers query and interfere with models that provide services in the form of application programming interfaces (APIs), which constitutes the black-box decision-based attack paradigm. However, to the best of our knowledge, decision-based attacks on AIGC detectors remain unexplored. In this study, we propose \textbf{FBA$^2$D}: a frequency-based black-box attack method for AIGC detection to fill the research gap. Motivated by frequency-domain discrepancies between generated and real images, we develop a decision-based attack that leverages the Discrete Cosine Transform (DCT) for fine-grained spectral partitioning and selects frequency bands as query subspaces, improving both query efficiency and image quality. Moreover, attacks on AIGC detectors should mitigate initialization failures, preserve image quality, and operate under strict query budgets. To address these issues, we adopt an ``adversarial example soup'' method, averaging candidates from successive surrogate iterations and using the result as the initialization to accelerate the query-based attack. The empirical study on the Synthetic LSUN dataset and GenImage dataset demonstrate the effectiveness of our prosed method. This study shows the urgency of addressing practical AIGC security problems.

cs.CR↗

Communication-Efficient Serving for Video Diffusion Models with Latent Parallelism

Video diffusion models (VDMs) perform attention computation over the 3D spatio-temporal domain. Compared to large language models (LLMs) processing 1D sequences, their memory consumption scales cubically, necessitating parallel serving across multiple GPUs. Traditional parallelism strategies partition the computational graph, requiring frequent high-dimensional activation transfers that create severe communication bottlenecks. To tackle this issue, we exploit the local spatio-temporal dependencies inherent in the diffusion denoising process and propose Latent Parallelism (LP), the first parallelism strategy tailored for VDM serving. \textcolor{black}{LP decomposes the global denoising problem into parallelizable sub-problems by dynamically rotating the partitioning dimensions (temporal, height, and width) within the compact latent space across diffusion timesteps, substantially reducing the communication overhead compared to prevailing parallelism strategies.} To ensure generation quality, we design a patch-aligned overlapping partition strategy that matches partition boundaries with visual patches and a position-aware latent reconstruction mechanism for smooth stitching. Experiments on three benchmarks demonstrate that LP reduces communication overhead by up to 97\% over baseline methods while maintaining comparable generation quality. As a non-intrusive plug-in paradigm, LP can be seamlessly integrated with existing parallelism strategies, enabling efficient and scalable video generation services.

cs.DC↗

The index of $t\mathcal{C}_{3}^{-}$-free signed graphs

The classical spectral Turán problem is to determine the maximum spectral radius of an $F$-free graph of order $n$. This paper extends this framework to signed graphs. Let $\mathcal{C}_r^-$ be the set of all unbalanced signed graphs with underlying graphs $C_r$. Wang, Hou and Li [Linear Algebra Appl, 681 (2024) 47-65] previously determined the spectral Turán number of $\mathcal{C}_{3}^{-}$. In the present work, we characterize the extremal graphs that achieve the maximum index among all unbalanced signed graphs of order $n$ that are $t\mathcal{C}{3}^{-}$-free for $t\geq 2$. Furthermore, for $t\geq 3$, we identify the graphs with the second maximum index among all $t\mathcal{C}{3}^{-}$-free unbalanced signed graphs of fixed order $n$.

math.CO↗

Toward Adaptive BCIs: Enhancing Decoding Stability via User State-Aware EEG Filtering

Brain-computer interfaces (BCIs) often suffer from limited robustness and poor long-term adaptability. Model performance rapidly degrades when user attention fluctuates, brain states shift over time, or irregular artifacts appear during interaction. To mitigate these issues, we introduce a user state-aware electroencephalogram (EEG) filtering framework that refines neural representations before decoding user intentions. The proposed method continuously estimates the user's cognitive state (e.g., focus or distraction) from EEG features and filters unreliable segments by applying adaptive weighting based on the estimated attention level. This filtering stage suppresses noisy or out-of-focus epochs, thereby reducing distributional drift and improving the consistency of subsequent decoding. Experiments on multiple EEG datasets that emulate real BCI scenarios demonstrate that the proposed state-aware filtering enhances classification accuracy and stability across different user states and sessions compared with conventional preprocessing pipelines. These findings highlight that leveraging brain-derived state information--even without additional user labels--can substantially improve the reliability of practical EEG-based BCIs.

eess.SP↗

DMA: Online RAG Alignment with Human Feedback

Retrieval-augmented generation (RAG) systems often rely on static retrieval, limiting adaptation to evolving intent and content drift. We introduce Dynamic Memory Alignment (DMA), an online learning framework that systematically incorporates multi-granularity human feedback to align ranking in interactive settings. DMA organizes document-, list-, and response-level signals into a coherent learning pipeline: supervised training for pointwise and listwise rankers, policy optimization driven by response-level preferences, and knowledge distillation into a lightweight scorer for low-latency serving. Throughout this paper, memory refers to the model's working memory, which is the entire context visible to the LLM for In-Context Learning. We adopt a dual-track evaluation protocol mirroring deployment: (i) large-scale online A/B ablations to isolate the utility of each feedback source, and (ii) few-shot offline tests on knowledge-intensive benchmarks. Online, a multi-month industrial deployment further shows substantial improvements in human engagement. Offline, DMA preserves competitive foundational retrieval while yielding notable gains on conversational QA (TriviaQA, HotpotQA). Taken together, these results position DMA as a principled approach to feedback-driven, real-time adaptation in RAG without sacrificing baseline capability.

cs.AI↗

Signals from Fermionic inflationary cosmology with Yukawa interaction

We investigate an inflationary model wherein the Dirac field $ψ$ is directly coupled to a scalar inflaton $ϕ$ via a Yukawa interaction $gϕ\barψψ$ and examine the resulting observational implications. Within the slow-roll approximation, we derive analytical solutions of the Dirac equations during inflation. The analytical result on the fermion pair density $\langle n\rangle$ indicates that the Yukawa interaction strength $g$ is to characterize the degree of non-adiabaticity. For large value of the dimensionless effective mass $\tilde m=(m+gϕ)/H$, i.e. $\tilde m\gtrsim 1$, the tensor-to-scalar ratio $r$ is suppressed by a factor of approximately $1/(1+2.95π^2g^2)$. This condition is also characterized by a significant backreaction. Conversely, if $\tilde m \ll 1$, the value of $r$ remains consistent with that observed in standard cold inflation. Our analysis is performed under the assumption of the highest inflationary energy scales compatible with current observational constraints.

gr-qc↗

OCTOPUS: A Versatile, User-Friendly, and Extensible Public Code for General-Relativistic Ray-Tracing in Spherically Symmetric and Static Spacetimes

This paper presents OCTOPUS, a relativistic ray-tracing algorithm developed within a Fortran-based, OpenMP-accelerated framework, designed for asymptotically flat, spherically symmetric curved spacetimes. The code efficiently and accurately computes key relativistic features -- including the black hole event horizon, photon rings, critical curves, and innermost stable circular orbits -- and simulates black hole shadows, redshift factor distributions, accretion disk images, toroidal images, as well as gravitational lensing, light curves, and gravitational radiation from hot-spots. OCTOPUS provides an automated, modular solution for qualitative studies of black hole observables and multi-messenger correlations between electromagnetic and gravitational signals in curved spacetime. Its implementation requires only the metric potential and its first-, second-, and third-order radial derivatives as input, ensuring low user barriers while remaining highly extensible and adaptable. Using a Schwarzschild black hole surrounded by a Dehnen-type dark matter halo, we thoroughly validate the algorithm's precision, efficiency, and functionality, and investigate how dark matter halo parameters affect observational signatures. Our results demonstrate that increasing the scale and density of the dark matter halo strengthens the spacetime's gravitational field, an effect clearly reflected in black hole images and supported by hot-spot light curve signatures. A future version of OCTOPUS, with expanded capabilities for axisymmetric spacetimes, is planned for release.

gr-qc↗

Generating High-Quality Datasets for Code Editing via Open-Source Language Models

Code editing plays a vital role in software engineering, requiring developers to adjust existing code according to natural language instructions while keeping functionality intact and avoiding unnecessary modifications. However, commit-based datasets commonly used for this task are often noisy, lack diversity, and fail to reflect the style of real-world edit instructions. To address this, we introduce OpenCodeEdit, an open-source pipeline that leverages multiple LLMs to synthesize realistic code-edit triplets. The pipeline produces both concise "lazy" instructions and more detailed "descriptive" ones, and applies filtering based on diffs and topics to guarantee data quality and variety. Using this process, we construct OCEDataFT, a curated dataset of 20K samples. Fine-tuning three advanced base models on OCEDataFT leads to significant performance boosts on the CanItEdit benchmark, with relative pass@1 improvements ranging from 4.50% to 20.79%. Notably, the resulting models achieve performance close to closed-source systems, narrowing the gap to GPT-4 to just 3.54%, without relying on proprietary resources or manual annotation.

cs.SE↗

Extremal distance spectral radius of graphs with $h$-extra $r$-component connectivity

For two integers $r\geq 2$ and $h\geq 0$, the $h$-extra $r$-component connectivity of a graph $G$, denoted by $cκ_{r}^{h}$, is defined as the minimum number of vertices whose removal produces a disconnected graph with at least $r$ components, where each component contains at least $h+1$ vertices. Let $\mathcal{G}_{n,δ}^{cκ_{r}^{h}}$ represent the set of graphs of order $n$ with minimum degree $δ$ and $h$-extra $r$-component connectivity $cκ_{r}^{h}$. Hu, Lin, and Zhang [\textit{Discrete Math.} \textbf{345} (2025) 114621] investigated the case when $h=0$ within $\mathcal{G}_{n,δ}^{cκ_{r}^{h}}$, and characterized the corresponding extremal graphs that minimize the distance spectral radius. In this paper, we further explore the relevant extremal graphs in $\mathcal{G}_{n,δ}^{cκ_{r}^{h}}$ for $h\geq 1$.

math.CO↗

ViSTR-GP: Online Cyberattack Detection via Vision-to-State Tensor Regression and Gaussian Processes in Automated Robotic Operations

Industrial robotic systems are central to automating smart manufacturing operations. Connected and automated factories face growing cybersecurity risks that can potentially cause interruptions and damages to physical operations. Among these attacks, data-integrity attacks often involve sophisticated exploitation of vulnerabilities that enable an attacker to access and manipulate the operational data and are hence difficult to detect with only existing intrusion detection or model-based detection. This paper addresses the challenges in utilizing existing side-channels to detect data-integrity attacks in robotic manufacturing processes by developing an online detection framework, ViSTR-GP, that cross-checks encoder-reported measurements against a vision-based estimate from an overhead camera outside the controller's authority. In this framework, a one-time interactive segmentation initializes SAM-Track to generate per-frame masks. A low-rank tensor-regression surrogate maps each mask to measurements, while a matrix-variate Gaussian process models nominal residuals, capturing temporal structure and cross-joint correlations. A frame-wise test statistic derived from the predictive distribution provides an online detector with interpretable thresholds. We validate the framework on a real-world robotic testbed with synchronized video frame and encoder data, collecting multiple nominal cycles and constructing replay attack scenarios with graded end-effector deviations. Results on the testbed indicate that the proposed framework recovers joint angles accurately and detects data-integrity attacks earlier with more frequent alarms than all baselines. These improvements are most evident in the most subtle attacks. These results show that plants can detect data-integrity attacks by adding an independent physical channel, bypassing the controller's authority, without needing complex instrumentation.

cs.RO↗

ConfLogger: Enhance Systems' Configuration Diagnosability through Configuration Logging

Modern configurable systems offer customization via intricate configuration spaces, yet such flexibility introduces pervasive configuration-related issues such as misconfigurations and latent softwarebugs. Existing diagnosability supports focus on post-failure analysis of software behavior to identify configuration issues, but none of these approaches look into whether the software clue sufficient failure information for diagnosis. To fill in the blank, we propose the idea of configuration logging to enhance existing logging practices at the source code level. We develop ConfLogger, the first tool that unifies configuration-aware static taint analysis with LLM-based log generation to enhance software configuration diagnosability. Specifically, our method 1) identifies configuration-sensitive code segments by tracing configuration-related data flow in the whole project, and 2) generates diagnostic log statements by analyzing configuration code contexts. Evaluation results on eight popular software systems demonstrate the effectiveness of ConfLogger to enhance configuration diagnosability. Specifically, ConfLogger-enhanced logs successfully aid a log-based misconfiguration diagnosis tool to achieve 100% accuracy on error localization in 30 silent misconfiguration scenarios, with 80% directly resolvable through explicit configuration information exposed. In addition, ConfLogger achieves 74% coverage of existing logging points, outperforming baseline LLM-based loggers by 12% and 30%. It also gains 8.6% higher in precision, 79.3% higher in recall, and 26.2% higher in F1 compared to the state-of-the-art baseline in terms of variable logging while also augmenting diagnostic value. A controlled user study on 22 cases further validated its utility, speeding up diagnostic time by 1.25x and improving troubleshooting accuracy by 251.4%.

cs.SE↗

Light Curves of Chaotic Charged Hot-Spots in Curved Spacetime: Opening an Observational Window to Chaos

The observed scarcity of chaotic phenomena in astronomy contrasts sharply with their theoretical significance, primarily due to the absence of a robust framework for detecting chaos. In this study, we numerically simulate the light curves of hot-spots in Kerr spacetime under the influence of an external asymptotically uniform electromagnetic field. Our results reveal a clear distinction between the light curves of chaotic and regular hot-spots, particularly in their power spectra: the latter display isolated, sharp peaks, while the former exhibit broad, continuous peaks of low amplitude. These findings highlight the potential of using light curves as a probe for chaotic orbits in curved spacetime.

gr-qc↗

Integrating Time Series into LLMs via Multi-layer Steerable Embedding Fusion for Enhanced Forecasting

Time series (TS) data are ubiquitous across various application areas, rendering time series forecasting (TSF) a fundamental task. With the astounding advances in large language models (LLMs), a variety of methods have been developed to adapt LLMs for time series forecasting. Despite unlocking the potential of LLMs in comprehending TS data, existing methods are inherently constrained by their shallow integration of TS information, wherein LLMs typically access TS representations at shallow layers, primarily at the input layer. This causes the influence of TS representations to progressively fade in deeper layers and eventually leads to ineffective adaptation between textual embeddings and TS representations. In this paper, we propose the Multi-layer Steerable Embedding Fusion (MSEF), a novel framework that enables LLMs to directly access time series patterns at all depths, thereby mitigating the progressive loss of TS information in deeper layers. Specifically, MSEF leverages off-the-shelf time series foundation models to extract semantically rich embeddings, which are fused with intermediate text representations across LLM layers via layer-specific steering vectors. These steering vectors are designed to continuously optimize the alignment between time series and textual modalities and facilitate a layer-specific adaptation mechanism that ensures efficient few-shot learning capabilities. Experimental results on seven benchmarks demonstrate significant performance improvements by MSEF compared with baselines, with an average reduction of 31.8% in terms of MSE. The code is available at https://github.com/One1sAll/MSEF.

cs.AI↗

Shadows of three black holes in static equilibrium configuration

In this paper, we employ a ray-tracing algorithm to simulate the shadows of three equal-mass black holes in static equilibrium across a wide parameter space. We find that the shadows consist of a larger primary shadow and several distorted, eyebrow-like secondary shadows. The boundaries of these profiles exhibit self-similar fractal structures, which can be attributed to the photon chaotic scattering. In certain parameter spaces, we also observe the ring-like shadows, with the ring diameter associated with the spacing of black holes. Furthermore, when the black holes approach each other sufficiently, their shadows can merge into a standard disk, suggesting a shadow degeneracy between closely arranged triple black holes and a single massive, spherically symmetric black hole. The shadow features of the triple black holes revealed in this study have potential implications for analyzing the shadow formation mechanisms, as well as the gravitational lensing during the merger and inspiral of black holes.

gr-qc↗