SearcharxivSearch

arXiv subjects

Li An

Publications and source records attributed to Li An.

14 recordsLinked to original sources

Practical Online KV Cache Compaction for LLM Agents: An Empirical Study

LLM agents accumulate long trajectories of reasoning steps, tool calls, and environment feedback, making the KV cache a major inference bottleneck. KV cache compaction can reduce this cost, but most prior methods assume a static context where future queries are known or can be approximated offline. Agents instead require online compaction: new information must be compressed before future relevance is known, using proxy queries cheap enough for the inference path. We study online compaction across token eviction (TE) and attention matching (AM), adapting both to compact agent turns and comparing cheap proxy sources such as boundary, repeat-prefill, and delayed future-generation queries. Experiments on BrowseComp-Plus and WideSearch show that immediate compaction often hurts performance, whereas delaying compaction to use the agent's future queries recovers much of the gap. Moreover, TE is often more robust than AM under imperfect proxies. Across models at different scales, TE preserves most of the accuracy while reducing KV cache by 80%, and can improve throughput over the no compaction baseline. These results position proxy-query selection as a core design choice for practical online KV compaction.

cs.CL

Speculate While You Reason: Teaching Agents to Predict Their Next Tool Call via Joint Agent-Speculator RL

Large language model agents often spend substantial wall-clock time waiting for tool call results. Tool-call speculation can hide this latency by predicting and pre-executing an agent's next tool call if the prediction matches the agent's eventual tool call, but existing speculators are typically separate draft models or cached traces that are poorly aligned with the deployed agent's own behavior. We identify this speculator-agent gap and show that the target agent itself is a strong next-call speculator. This points to a simpler design: unifying the agent and speculator within the same model. In this paper, we introduce the self-speculating agent, a single model that both solves tasks in agent mode and predicts its next tool call from partial trajectories in speculator mode, fully reusing prefix KV cache. To enable this dual-mode agent without degrading performance, we propose a joint agent-speculator reinforcement learning method, which derives speculation targets from the agent's own rollouts and alternates agent and speculator updates. Across agentic search QA and conversational tool-use agentic tasks, our method improves average next tool-call Hit@1 from 44.1 to 61.2 for Qwen3-4B and from 48.9 to 66.3 for Qwen3.5-4B, while preserving agent task success.

cs.AI

VISUALSKILL: Multimodal Skills for Computer-Use Agents

Computer-use agents (CUAs) approach human-level performance on standardised benchmarks but still struggle on long-horizon tasks and unseen software. Existing skill libraries address this with reusable skills, but represent the skill artifact as text only, despite the visual nature of GUI interaction. We propose VISUALSKILL: a hierarchical multimodal skill, tailored to each target application and organised as a central index over per-topic files, which the agent consumes through a load_topic MCP tool that fetches the relevant topic's text and figures on demand. We construct each skill with a two-stage pipeline that combines authored documentation with live-application UI exploration. On two CUA benchmarks, CUA-World and OSExpert-Eval, a Claude Code CLI agent backed by Claude Opus 4.6 reaches an average score of 0.456 with VISUALSKILL, a +15.3 point absolute lift over the no-skill baseline (0.303). Against a matched text-only skill that is generated from the same source content and differs from VISUALSKILL only in modality, VISUALSKILL yields a further +8.3 point absolute gain over the matched text-only skill (0.373 vs. 0.456), providing direct evidence that retaining visual figures in the skill artifact, rather than verbalizing them away, helps the agent both identify UI elements and verify workflow state after each action. Our code is available at https://github.com/XMHZZ2018/VisualSkills.

cs.CL

Lightweight Multimodal Adaptation of Vision Language Models for Species Recognition and Habitat Context Interpretation in Drone Thermal Imagery

This study proposes a lightweight multimodal adaptation framework to bridge the representation gap between RGB-pretrained VLMs and thermal infrared imagery, and demonstrates its practical utility using a real drone-collected dataset. A thermal dataset was developed from drone-collected imagery and was used to fine-tune VLMs through multimodal projector alignment, enabling the transfer of information from RGB-based visual representations to thermal radiometric inputs. Three representative models, including InternVL3-8B-Instruct, Qwen2.5-VL-7B-Instruct, and Qwen3-VL-8B-Instruct, were benchmarked under both closed-set and open-set prompting conditions for species recognition and instance enumeration. Among the tested models, Qwen3-VL-8B-Instruct with open-set prompting achieved the best overall performance, with F1 scores of 0.935 for deer, 0.915 for rhino, and 0.968 for elephant, and within-1 enumeration accuracies of 0.779, 0.982, and 1.000, respectively. In addition, combining thermal imagery with simultaneously collected RGB imagery enabled the model to generate habitat-context information, including land-cover characteristics, key landscape features, and visible human disturbance. Overall, the findings demonstrate that lightweight projector-based adaptation provides an effective and practical route for transferring RGB-pretrained VLMs to thermal drone imagery, expanding their utility from object-level recognition to habitat-context interpretation in ecological monitoring.

cs.CV

How Well Do Agentic Skills Work in the Wild: Benchmarking LLM Skill Usage in Realistic Settings

Agent skills, which are reusable, domain-specific knowledge artifacts, have become a popular mechanism for extending LLM-based agents, yet formally benchmarking skill usage performance remains scarce. Existing skill benchmarking efforts focus on overly idealized conditions, where LLMs are directly provided with hand-crafted, narrowly-tailored task-specific skills for each task, whereas in many realistic settings, the LLM agent may have to search for and select relevant skills on its own, and even the closest matching skills may not be well-tailored for the task. In this paper, we conduct the first comprehensive study of skill utility under progressively challenging realistic settings, where agents must retrieve skills from a large collection of 34k real-world skills and may not have access to any hand-curated skills. Our findings reveal that the benefits of skills are fragile: performance gains degrade consistently as settings become more realistic, with pass rates approaching no-skill baselines in the most challenging scenarios. To narrow this gap, we study skill refinement strategies, including query-specific and query-agnostic approaches, and we show that query-specific refinement substantially recovers lost performance when the initial skills are of reasonable relevance and quality. We further demonstrate the generality of retrieval and refinement on Terminal-Bench 2.0, where they improve the pass rate of Claude Opus 4.6 from 57.7% to 65.5%. Our results, consistent across multiple models, highlight both the promise and the current limitations of skills for LLM-based agents. Our code is available at https://github.com/UCSB-NLP-Chang/Skill-Usage.

cs.CL

A Reinforcement Learning Framework for Robust and Secure LLM Watermarking

Watermarking has emerged as a promising solution for tracing and authenticating text generated by large language models (LLMs). A common approach to LLM watermarking is to construct a green/red token list and assign higher or lower generation probabilities to the corresponding tokens, respectively. However, most existing watermarking algorithms rely on heuristic green/red token list designs, as directly optimizing the list design with techniques such as reinforcement learning (RL) comes with several challenges. First, desirable watermarking involves multiple criteria, i.e., detectability, text quality, robustness against removal attacks, and security against spoofing attacks. Directly optimizing for these criteria introduces many partially conflicting reward terms, leading to an unstable convergence process. Second, the vast action space of green/red token list choices is susceptible to reward hacking. In this paper, we propose an end-to-end RL framework for robust and secure LLM watermarking. Our approach adopts an anchoring mechanism for reward terms to ensure stable training and introduces additional regularization terms to prevent reward hacking. Experiments on standard benchmarks with two backbone LLMs show that our method achieves a state-of-the-art trade-off across all criteria, with notable improvements in resistance to spoofing attacks without degrading other criteria. Our code is available at https://github.com/UCSB-NLP-Chang/RL-watermark.

cs.CR

Multi-perspective monitoring of wildlife and human activities from camera traps and drones with deep learning models

Wildlife and human activities are key components of landscape systems. Understanding their spatial distribution is essential for evaluating human wildlife interactions and informing effective conservation planning. Multiperspective monitoring of wildlife and human activities by combining camera traps and drone imagery. Capturing the spatial patterns of their distributions, which allows the identification of the overlap of their activity zones and the assessment of the degree of human wildlife conflict. The study was conducted in Chitwan National Park (CNP), Nepal, and adjacent regions. Images collected by visible and nearinfrared camera traps and thermal infrared drones from February to July 2022 were processed to create training and testing datasets, which were used to build deep learning models to automatic identify wildlife and human activities. Drone collected thermal imagery was used for detecting targets to provide a multiple monitoring perspective. Spatial pattern analysis was performed to identify animal and resident activity hotspots and delineation potential human wildlife conflict zones. Among the deep learning models tested, YOLOv11s achieved the highest performance with a precision of 96.2%, recall of 92.3%, mAP50 of 96.7%, and mAP50 of 81.3%, making it the most effective for detecting objects in camera trap imagery. Drone based thermal imagery, analyzed with an enhanced Faster RCNN model, added a complementary aerial viewpoint for camera trap detections. Spatial pattern analysis identified clear hotspots for both wildlife and human activities and their overlapping patterns within certain areas in the CNP and buffer zones indicating potential conflict. This study reveals human wildlife conflicts within the conserved landscape. Integrating multiperspective monitoring with automated object detection enhances wildlife surveillance and landscape management.

cs.CV

Defending LLM Watermarking Against Spoofing Attacks with Contrastive Representation Learning

Watermarking has emerged as a promising technique for detecting texts generated by LLMs. Current research has primarily focused on three design criteria: high quality of the watermarked text, high detectability, and robustness against removal attack. However, the security against spoofing attacks remains relatively understudied. For example, a piggyback attack can maliciously alter the meaning of watermarked text-transforming it into hate speech-while preserving the original watermark, thereby damaging the reputation of the LLM provider. We identify two core challenges that make defending against spoofing difficult: (1) the need for watermarks to be both sensitive to semantic-distorting changes and insensitive to semantic-preserving edits, and (2) the contradiction between the need to detect global semantic shifts and the local, auto-regressive nature of most watermarking schemes. To address these challenges, we propose a semantic-aware watermarking algorithm that post-hoc embeds watermarks into a given target text while preserving its original meaning. Our method introduces a semantic mapping model, which guides the generation of a green-red token list, contrastively trained to be sensitive to semantic-distorting changes and insensitive to semantic-preserving changes. Experiments on two standard benchmarks demonstrate strong robustness against removal attacks and security against spoofing attacks, including sentiment reversal and toxic content insertion, while maintaining high watermark detectability. Our approach offers a significant step toward more secure and semantically aware watermarking for LLMs. Our code is available at https://github.com/UCSB-NLP-Chang/contrastive-watermark.

cs.CR

Triggering the Untriggered: The First Einstein Probe-Detected Gamma-Ray Burst 240219A and Its Implications

The Einstein Probe (EP) achieved its first detection and localization of a bright X-ray flare, EP240219a, on 2024 February 19, during its commissioning phase. Subsequent targeted searches triggered by the EP240219a alert identified a faint, untriggered gamma-ray burst (GRB) in the archived data of Fermi Gamma-ray Burst Monitor (GBM), Swift Burst Alert Telescope (BAT), and Insight-HXMT/HE. The EP Wide-field X-ray Telescope (WXT) light curve reveals a long duration of approximately 160 s with a slow decay, whereas the Fermi/GBM light curve shows a total duration of approximately 70 s. The peak in the Fermi/GBM light curve occurs slightly later with respect to the peak seen in the EP/WXT light curve. Our spectral analysis shows that a single cutoff power-law (PL) model effectively describes the joint EP/WXT--Fermi/GBM spectra in general, indicating coherent broad emission typical of GRBs. The model yielded a photon index of $\sim -1.70 \pm 0.05$ and a peak energy of $\sim 257 \pm 134$ keV. After detection of GRB 240219A, long-term observations identified several candidates in optical and radio wavelengths, none of which was confirmed as the afterglow counterpart during subsequent optical and near-infrared follow-ups. The analysis of GRB 240219A classifies it as an X-ray rich GRB (XRR) with a high peak energy, presenting both challenges and opportunities for studying the physical origins of X-ray flashes, XRRs, and classical GRBs. Furthermore, linking the cutoff PL component to nonthermal synchrotron radiation suggests that the burst is driven by a Poynting flux-dominated outflow.

astro-ph.HE

Towards Chapter-to-Chapter Context-Aware Literary Translation via Large Language Models

Discourse phenomena in existing document-level translation datasets are sparse, which has been a fundamental obstacle in the development of context-aware machine translation models. Moreover, most existing document-level corpora and context-aware machine translation methods rely on an unrealistic assumption on sentence-level alignments. To mitigate these issues, we first curate a novel dataset of Chinese-English literature, which consists of 160 books with intricate discourse structures. Then, we propose a more pragmatic and challenging setting for context-aware translation, termed chapter-to-chapter (Ch2Ch) translation, and investigate the performance of commonly-used machine translation models under this setting. Furthermore, we introduce a potential approach of finetuning large language models (LLMs) within the domain of Ch2Ch literary translation, yielding impressive improvements over baselines. Through our comprehensive analysis, we unveil that literary translation under the Ch2Ch setting is challenging in nature, with respect to both model learning methods and translation decoding algorithms.

cs.CL

In Vivo GABA Detection by Single Pulse Editing with One Shot

Over the past two decades, magnetic resonance spectroscopy with two-shot difference editing has been widely employed to characterize altered levels of GABA, the primary inhibitory neurotransmitter in the brain, in various neuropsychiatric disorders. This conventional technique detects the GABA H4 resonance, making it unsuitable for investigating GABA metabolism. It also suffers from subtraction artifacts, signal loss, and significant contamination by macromolecules. Here, we introduce a single-shot method for detecting GABA H2, effectively overcoming these difficulties. Since GABA turnover initiates at its protonated C2 and unprotonated C1 positions, we demonstrate, for the first time, noninvasive real-time monitoring of GABA metabolism in the human brain, utilizing GABA H2 as a highly sensitive reporter for GABA C2. This new method not only enhances the quantitative measurement of GABA levels but also opens up a new avenue to probe the metabolic processes underlying alterations in GABA levels in patients.

physics.med-ph

In Vivo Magnetic Resonance Spectroscopy by J-Locked Chemical Shift Encoding for Determination of Neurochemical Concentration and Transverse Relaxation Time

Cell pathology in neuropsychiatric disorders has mainly been accessible by analyzing postmortem tissue samples. Although molecular transverse relaxation informs local cellular microenvironment via molecule-environment interactions, precise determination of the transverse relaxation times of molecules with scalar couplings (J), such as glutamate and glutamine, is difficult using current in vivo magnetic resonance spectroscopy (MRS) technologies, whose approach to measuring transverse relaxation has not changed for decades. We introduce an in vivo MRS technique that achieves chemical shift encoding with selectively locked J-couplings in each column of the acquired two-dimensional dataset, freeing up the entire row dimension for transverse relaxation encoding. This results in increased spectral resolution, minimized background signals, and markedly broadened dynamic range for transverse relaxation encoding. This technique enables determination of the transverse relaxation times of glutamate and glutamine in vivo with unprecedented high precision. Since glutamate predominantly resides in glutamatergic neurons and glutamine in glia in the brain, this noninvasive technique provides a way to probe cellular pathophysiology in neuropsychiatric disorders for characterizing disease progression and monitoring treatment response in a cell type-specific manner in vivo.

physics.med-ph

Unfolding the fast neutron spectra of a BC501A liquid scintillation detector using GRAVEL method

Accurate knowledge of the neutron energy spectra is useful in basic research and applications. The overall procedure of measuring and unfolding the fast neutron energy spectra with BC501A liquid scintillation detector is described. The recoil proton spectrum of Am-Be neutrons was obtained experimentally. With the NRESP7 code, the response matrix of detector was simulated. Combining the recoil proton spectrum and response matrix, the unfolding of neutron spectra was performed by GRAVEL iterative algorithm. A MatLab program based on the GRAVEL method was developed. The continuous neutron spectrum of Am-Be source and monoenergetic neutron spectrum of D-T source have been unfolded successfully and are in good agreement with their standard reference spectra. The unfolded Am-Be spectrum are more accurate than the spectra unfolded by artificial neural networks in recent years.

physics.ins-det

Study of n-{\gamma} discrimination in low energy range (above 40 keVee) by charge comparison method with a BC501A liquid scintillation detector

A VME-based experiment system for n-{\gamma} discrimination using the charge comparison method was established. A data acquisition program for controlling the programmable modules and processing data online via VME64X bus was developed through the use of LabVIEW. The two-dimensional (2D) scatter plots of the charge in the slow component vs. the total charge of recorded pulses from Am-Be and Cf neutron sources were presented. The 2D scatter plots of the energy vs. the ratio of the charge in the slow component to the total charge of the pulses were presented at the meantime. The quality of n-{\gamma} discrimination was checked by the figure-of-merit, and the results showed good performance of n-{\gamma} discrimination at low energy range. Neutrons and {\gamma}-rays were separated above 50 keVee (electron-equivalent energy). The quality of n-{\gamma} discrimination have been improved compared with others' results at 5 energies (150, 250, 350, 450, 550 keVee).

physics.ins-det