Search arXiv⌕ Search

arXiv subjects

Jun Yan

Publications and source records attributed to Jun Yan.

At least 73 records · Page 4Linked to original sources

Co-Evolution of Types and Dependencies: Towards Repository-Level Type Inference for Python Code

Python's dynamic typing mechanism, while promoting flexibility, is a significant source of runtime type errors that plague large-scale software, which inspires the automatic type inference techniques. Existing type inference tools have achieved advances in type inference within isolated code snippets. However, repository-level type inference remains a significant challenge, primarily due to the complex inter-procedural dependencies that are difficult to model and resolve. To fill this gap, we present \methodName, a novel approach based on LLMs that achieves repository-level type inference through the co-evolution of types and dependencies. \methodName~constructs an Entity Dependency Graph (EDG) to model the objects and type dependencies across the repository. During the inference process, it iteratively refines types and dependencies in EDG for accurate type inference. Our key innovations are: (1) an EDG model designed to capture repository-level type dependencies; (2) an iterative type inference approach where types and dependencies co-evolve in each iteration; and (3) a type-checker-in-the-loop strategy that validates and corrects inferences on-the-fly, thereby reducing error propagation. When evaluated on 12 complex Python repositories, \methodName~significantly outperformed prior works, achieving a \textit{TypeSim} score of 0.89 and a \textit{TypeExact} score of 0.84, representing a 27\% and 40\% relative improvement over the strongest baseline. More importantly, \methodName~removed new type errors introduced by the tool by 92.7\%. This demonstrates a significant leap towards automated, reliable type annotation for real-world Python development.

cs.SE↗

A Further Comparison of MPS and TTNS for Nonadiabatic Dynamics of Exciton Dissociation

Tensor networks, such as matrix product states (MPS) and tree tensor network states (TTNS), are powerful ansätze for simulating quantum dynamics. While both ansätze are theoretically exact in the limit of large bond dimensions, [J. Chem. Theory Comput. 2024, 20, 8767-8781] reported a non-negligible discrepancy in its calculations for exciton dissociation. To resolve this inconsistency, we conduct a systematic comparison using Renormalizer, a unified software framework for MPS and TTNS. By revisiting the benchmark P3HT:PCBM heterojunction model, we show that the observed discrepancies arise primarily from insufficient bond dimensions. By increasing bond dimensions, we reduce the relative difference in occupancy for weakly populated electronic states from up to 60% towards the end of the simulation to less than 10% and the absolute difference from 0.05 to 0.005. We also discuss the impact of tensor network structures on accuracy and efficiency, with the difference further reduced by an optimized TTNS structure. Our results confirm that both methods converge to numerically exact solutions when bond dimensions are adequately scaled. This work not only validates the reliability of both methods but also provides high-accuracy benchmark data for future developments in quantum dynamics simulations.

physics.chem-ph↗

Self-Refined Generative Foundation Models for Wireless Traffic Prediction

With a broad range of emerging applications in 6G networks, wireless traffic prediction has become a critical component of network management. However, the dynamically shifting distribution of wireless traffic in non-stationary 6G networks presents significant challenges to achieving accurate and stable predictions. Motivated by recent advancements in Generative AI (GenAI)-enabled 6G networks, this paper proposes a novel self-refined Large Language Model (LLM) for wireless traffic prediction, namely TrafficLLM, through in-context learning without parameter fine-tuning or model training. The proposed TrafficLLM harnesses the powerful few-shot learning abilities of LLMs to enhance the scalability of traffic prediction in dynamically changing wireless environments. Specifically, our proposed TrafficLLM embraces an LLM to iteratively refine its predictions through a three-step process: traffic prediction, feedback generation, and prediction refinement. Initially, the proposed TrafficLLM conducts traffic predictions using task-specific demonstration prompts. Recognizing that LLMs may generate incorrect predictions on the first attempt, this paper designs feedback demonstration prompts to provide multifaceted and valuable feedback related to these initial predictions. The validation scheme is further incorporated to systematically enhance the accuracy of mathematical calculations during the feedback generation process. Following this comprehensive feedback, our proposed TrafficLLM introduces refinement demonstration prompts, enabling the same LLM to further refine its predictions and thereby enhance prediction performance. Evaluations on two realistic datasets demonstrate that the proposed TrafficLLM outperforms LLM-based in-context learning methods, achieving performance improvements of 23.17% and 17.09%, respectively.

eess.SY↗

Covariate Connectivity Combined Clustering for Weighted Networks

Community detection is a central task in network analysis, with applications in social, biological, and technological systems. Traditional algorithms rely primarily on network topology, which can fail when community signals are partly encoded in node-specific attributes. Existing covariate-assisted methods often assume the number of clusters is known, involve computationally intensive inference, or are not designed for weighted networks. We propose $\text{C}^4$: Covariate Connectivity Combined Clustering, an adaptive spectral clustering algorithm that integrates network connectivity and node-level covariates into a unified similarity representation. $\text{C}^4$ balances the two sources of information through a data-driven tuning parameter, estimates the number of communities via an eigengap heuristic, and avoids reliance on costly sampling-based procedures. Simulation studies show that $\text{C}^4$ achieves higher accuracy and robustness than competing approaches across diverse scenarios. Application to an airport reachability network demonstrates the method's scalability, interpretability, and practical utility for real-world weighted networks.

stat.ME↗

Asymmetric Ramsey numbers of trees

Let $n\geqν$, let $T$ be an $n$-vertex tree with bipartition class sizes $t_1\geq t_2$, and let $S$ be a $ν$-vertex tree with bipartition class sizes $τ_1\geqτ_2$. Using four natural constructions, we show that the Ramsey number $R(T,S)$ is lower bounded by $\underline{R}(T,S)=\max\{n+τ_2,ν+\min\{t_2,ν\},\min\{2t_1,2ν\},2τ_1\}-1$. Our main result shows that there exists a constant $c>0$, such that for all sufficiently large integers $n\geqν$, if (i) $Δ(T)\leq cn/\log n$ and $Δ(S)\leq cν/\logν$, (ii) $τ_2\geq t_2$, and (iii) $ν\geq t_1$, then $R(T,S)=\underline{R}(T,S)$. In particular, this determines the exact Ramsey numbers for a large family of pairs of trees. We also provide examples showing that $R(T,S)$ can exceed $\underline{R}(T,S)$ if any one of the three assumptions (i), (ii), and (iii) is removed.

math.CO↗

Statistical Inferences and Predictions for Areal Data and Spatial Data Fusion with Hausdorff--Gaussian Processes

Accurate modeling of spatial dependence is pivotal in analyzing spatial data, influencing parameter estimation and predictions. The spatial structure of the data significantly impacts valid statistical inference. Existing models for areal data often rely on adjacency matrices, struggling to differentiate between polygons of varying sizes and shapes. Conversely, data fusion models rely on computationally intensive numerical integrals, presenting challenges for moderately large datasets. In response to these issues, we propose the Hausdorff-Gaussian process (HGP), a versatile model utilizing the Hausdorff distance to capture spatial dependence in both point and areal data. Integration into generalized linear mixed-effects models enhances its applicability, particularly in addressing data fusion challenges. We validate our approach through a comprehensive simulation study and application to two real-world scenarios: one involving areal data and another demonstrating its effectiveness in data fusion. The results suggest that the HGP is competitive with specialized models regarding goodness-of-fit and prediction performances. In summary, the HGP offers a flexible and robust solution for modeling spatial data of various types and shapes, with potential applications spanning fields such as public health and climate science.

stat.ME↗

Nonparametric Block Bootstrap Kolmogorov-Smirnov Goodness-of-Fit Test

The Kolmogorov--Smirnov (KS) test is a widely used statistical test that assesses the conformity of a sample to a specified distribution. Its efficacy, however, diminishes with serially dependent data and when parameters within the hypothesized distribution are unknown. For independent data, parametric and nonparametric bootstrap procedures are available to adjust for estimated parameters. For serially dependent stationary data, parametric bootstrap has been developed with a working serial dependence structure. A counterpart for the nonparametric bootstrap approach, which needs a bias correction, has not been studied. Addressing this gap, our study introduces a bias correction method employing a nonparametric block bootstrap, which approximates the distribution of the KS statistic in assessing the goodness-of-fit of the marginal distribution of a stationary series, accounting for unspecified serial dependence and unspecified parameters. We assess its effectiveness through simulations, scrutinizing both its size and power. The practicality of our method is further illustrated with an examination of stock returns from the S\&P 500 index, showcasing its utility in real-world applications.

stat.ME↗

PANER: A Paraphrase-Augmented Framework for Low-Resource Named Entity Recognition

Named Entity Recognition (NER) is a critical task that requires substantial annotated data, making it challenging in low-resource scenarios where label acquisition is expensive. While zero-shot and instruction-tuned approaches have made progress, they often fail to generalize to domain-specific entities and do not effectively utilize limited available data. We present a lightweight few-shot NER framework that addresses these challenges through two key innovations: (1) a new instruction tuning template with a simplified output format that combines principles from prior IT approaches to leverage the large context window of recent state-of-the-art LLMs; (2) introducing a strategic data augmentation technique that preserves entity information while paraphrasing the surrounding context, thereby expanding our training data without compromising semantic relationships. Experiments on benchmark datasets show that our method achieves performance comparable to state-of-the-art models on few-shot and zero-shot tasks, with our few-shot approach attaining an average F1 score of 80.1 on the CrossNER datasets. Models trained with our paraphrasing approach show consistent improvements in F1 scores of up to 17 points over baseline versions, offering a promising solution for groups with limited NER training data and compute power.

cs.CL↗

Spanning trees with large maximum degrees

The celebrated result of Komlós, Sárközy, and Szemerédi states that for any $\varepsilon>0$, there exists $0<c<1$, such that for all sufficiently large $n$, every $n$-vertex graph $G$ with $δ(G)\geq(1/2+\varepsilon)n$ contains every $n$-vertex tree with maximum degree at most $cn/\log n$. This is best possible up to the value of $c$. In this paper, we extend this result to trees with higher maximum degrees, and prove that for $Δ\gg n/\log n$, roughly speaking, $δ(G)\geq n-n^{1-(1+o(1))Δ/n}$ is the asymptotically optimal minimum degree condition which guarantees that $G$ contains every $n$-vertex spanning tree with maximum degree at most $Δ$. We also prove the corresponding statements in the random graph setting.

math.CO↗

Enabling AI Scientists to Recognize Innovation: A Domain-Agnostic Algorithm for Assessing Novelty

In the pursuit of Artificial General Intelligence (AGI), automating the generation and evaluation of novel research ideas is a key challenge in AI-driven scientific discovery. This paper presents Relative Neighbor Density (RND), a domain-agnostic algorithm for novelty assessment in research ideas that overcomes the limitations of existing approaches by comparing an idea's local density with its adjacent neighbors' densities. We first developed a scalable methodology to create test set without expert labeling, addressing a fundamental challenge in novelty assessment. Using these test sets, we demonstrate that our RND algorithm achieves state-of-the-art (SOTA) performance in computer science (AUROC=0.820) and biomedical research (AUROC=0.765) domains. Most significantly, while SOTA models like Sonnet-3.7 and existing metrics show domain-specific performance degradation, RND maintains consistent accuracies across domains by its domain-invariant property, outperforming all benchmarks by a substantial margin (0.795 v.s. 0.597) on cross-domain evaluation. These results validate RND as a generalizable solution for automated novelty assessment in scientific research.

cs.AI↗

Rethinking Backdoor Detection Evaluation for Language Models

Backdoor attacks, in which a model behaves maliciously when given an attacker-specified trigger, pose a major security risk for practitioners who depend on publicly released language models. As a countermeasure, backdoor detection methods aim to detect whether a released model contains a backdoor. While existing backdoor detection methods have high accuracy in detecting backdoored models on standard benchmarks, it is unclear whether they can robustly identify backdoors in the wild. In this paper, we examine the robustness of backdoor detectors by manipulating different factors during backdoor planting. We find that the success of existing methods based on trigger inversion or meta classifiers highly depends on how intensely the model is trained on poisoned data. Specifically, backdoors planted with more aggressive or more conservative training are significantly more difficult to detect than the default ones. Our results highlight a lack of robustness of existing backdoor detectors and the limitations in current benchmark construction.

cs.CL↗

Lattice paths enumerations weighted by ascent lengths

Recent work of the author connected several parking function enumeration problems to enumerations of Catalan paths with respect to certain weight functions that are expressed in terms of the ascent lengths. Motivated by this, we generalise and solve analogous weighted enumeration problems for a large family of lattice paths and weight functions, and discuss their connections with other enumeration problems and OEIS entries.

math.CO↗

Ramsey numbers of trees

We show that there exists a constant $c>0$ such that every $n$-vertex tree $T$ with $Δ(T)\le cn$ has Ramsey number $R(T)=\max\{t_1+2t_2,2t_1\}-1$, where $t_1\ge t_2$ are the sizes of the bipartition classes of $T$. This improves an asymptotic result of Haxell, Łuczak, and Tingley from 2002, and shows that, though Burr's 1974 conjecture on the Ramsey numbers of trees has long been known to be false for certain `double stars', it is true for trees with up to small linear maximum degree.

math.CO↗

Probing the Nanoscale Excitonic Landscape and Quantum Confinement of Excitons in Gated Monolayer Semiconductors

Engineering and probing excitonic properties at the nanoscale remains a central challenge in quantum photonics and optoelectronics. While exciton confinement via electrical control and strain engineering has been demonstrated in 2D semiconductors, substantial nanoscale heterogeneity limits the scalability of 2D quantum photonic device architectures. In this work, we use cathodoluminescence spectroscopy to probe the excitonic landscape of monolayer $WS_2$ under electrostatic gating. Exploiting the high spatial resolution of the converged electron beam, we resolve a homojunction arising between gated and ungated regions. Moreover, we reveal an exciton confinement channel arising from an unconventional doping mechanism driven by the interplay between the electron beam and the applied gate fields. These findings offer new insights into the optoelectronic behavior of monolayer semiconductors under the combined influence of electron-beam excitation and electrostatic gating. Our approach provides a pathway for exciton manipulation at the nanoscale and opens opportunities for controlling quantum-confined exciton transport in two-dimensional materials.

cond-mat.mes-hall↗

LDRFusion: A LiDAR-Dominant multimodal refinement framework for 3D object detection

Existing LiDAR-Camera fusion methods have achieved strong results in 3D object detection. To address the sparsity of point clouds, previous approaches typically construct spatial pseudo point clouds via depth completion as auxiliary input and adopts a proposal-refinement framework to generate detection results. However, introducing pseudo points inevitably brings noise, potentially resulting in inaccurate predictions. Considering the differing roles and reliability levels of each modality, we propose LDRFusion, a novel Lidar-dominant two-stage refinement framework for multi-sensor fusion. The first stage soley relies on LiDAR to produce accurately localized proposals, followed by a second stage where pseudo point clouds are incorporated to detect challenging instances. The instance-level results from both stages are subsequently merged. To further enhance the representation of local structures in pseudo point clouds, we present a hierarchical pseudo point residual encoding module, which encodes neighborhood sets using both feature and positional residuals. Experiments on the KITTI dataset demonstrate that our framework consistently achieves strong performance across multiple categories and difficulty levels.

cs.CV↗

DSADF: Thinking Fast and Slow for Decision Making

Although Reinforcement Learning (RL) agents are effective in well-defined environments, they often struggle to generalize their learned policies to dynamic settings due to their reliance on trial-and-error interactions. Recent work has explored applying Large Language Models (LLMs) or Vision Language Models (VLMs) to boost the generalization of RL agents through policy optimization guidance or prior knowledge. However, these approaches often lack seamless coordination between the RL agent and the foundation model, leading to unreasonable decision-making in unfamiliar environments and efficiency bottlenecks. Making full use of the inferential capabilities of foundation models and the rapid response capabilities of RL agents and enhancing the interaction between the two to form a dual system is still a lingering scientific question. To address this problem, we draw inspiration from Kahneman's theory of fast thinking (System 1) and slow thinking (System 2), demonstrating that balancing intuition and deep reasoning can achieve nimble decision-making in a complex world. In this study, we propose a Dual-System Adaptive Decision Framework (DSADF), integrating two complementary modules: System 1, comprising an RL agent and a memory space for fast and intuitive decision making, and System 2, driven by a VLM for deep and analytical reasoning. DSADF facilitates efficient and adaptive decision-making by combining the strengths of both systems. The empirical study in the video game environment: Crafter and Housekeep demonstrates the effectiveness of our proposed method, showing significant improvements in decision abilities for both unseen and known tasks.

cs.LG↗

In Prospect and Retrospect: Reflective Memory Management for Long-term Personalized Dialogue Agents

Large Language Models (LLMs) have made significant progress in open-ended dialogue, yet their inability to retain and retrieve relevant information from long-term interactions limits their effectiveness in applications requiring sustained personalization. External memory mechanisms have been proposed to address this limitation, enabling LLMs to maintain conversational continuity. However, existing approaches struggle with two key challenges. First, rigid memory granularity fails to capture the natural semantic structure of conversations, leading to fragmented and incomplete representations. Second, fixed retrieval mechanisms cannot adapt to diverse dialogue contexts and user interaction patterns. In this work, we propose Reflective Memory Management (RMM), a novel mechanism for long-term dialogue agents, integrating forward- and backward-looking reflections: (1) Prospective Reflection, which dynamically summarizes interactions across granularities-utterances, turns, and sessions-into a personalized memory bank for effective future retrieval, and (2) Retrospective Reflection, which iteratively refines the retrieval in an online reinforcement learning (RL) manner based on LLMs' cited evidence. Experiments show that RMM demonstrates consistent improvement across various metrics and benchmarks. For example, RMM shows more than 10% accuracy improvement over the baseline without memory management on the LongMemEval dataset.

cs.CL↗

FedDifRC: Unlocking the Potential of Text-to-Image Diffusion Models in Heterogeneous Federated Learning

Federated learning aims at training models collaboratively across participants while protecting privacy. However, one major challenge for this paradigm is the data heterogeneity issue, where biased data preferences across multiple clients, harming the model's convergence and performance. In this paper, we first introduce powerful diffusion models into the federated learning paradigm and show that diffusion representations are effective steers during federated training. To explore the possibility of using diffusion representations in handling data heterogeneity, we propose a novel diffusion-inspired Federated paradigm with Diffusion Representation Collaboration, termed FedDifRC, leveraging meaningful guidance of diffusion models to mitigate data heterogeneity. The key idea is to construct text-driven diffusion contrasting and noise-driven diffusion regularization, aiming to provide abundant class-related semantic information and consistent convergence signals. On the one hand, we exploit the conditional feedback from the diffusion model for different text prompts to build a text-driven contrastive learning strategy. On the other hand, we introduce a noise-driven consistency regularization to align local instances with diffusion denoising representations, constraining the optimization region in the feature space. In addition, FedDifRC can be extended to a self-supervised scheme without relying on any labeled data. We also provide a theoretical analysis for FedDifRC to ensure convergence under non-convex objectives. The experiments on different scenarios validate the effectiveness of FedDifRC and the efficiency of crucial components.

cs.LG↗