arXiv:2605.22976v1 Announce Type: new
Abstract: Large Language Models (LLMs) are increasingly integrated into software systems for diverse purposes, due to their versatility, flexibility, and ability to simulate human reasoning to some extent. However, poor integration of LLM inference in source code can undermine software system quality. Therefore, inadequate LLM integration coding practices must be documented to help developers mitigate such issues. Following our earlier work on LLM code smells, this paper consolidates and refines the concept by presenting a self-contained taxonomy and a catalog of nine LLM code smells. We also create SpecDetect4LLM, a static source code analysis tool for their detection, and conduct extensive empirical evaluations of its detection effectiveness (precision and recall) as well as the prevalence of LLM code smells across 692 open-source software projects (171,194 source files). Our results show that LLM code smells affect 73.5% of the analyzed systems, with a detection precision of 91.3% and a recall of 71.8%.
Science Journals
arXiv:2605.23710v1 Announce Type: new
Abstract: Semantic type mismatch between a noun and its context is central to coercion phenomena. This paper introduces a graph-based method to examine how lexical and contextual type information is reflected in word embeddings. We select nouns from ten semantic types, annotate corpus instances for type matching (matching vs. coercion vs. other mismatch vs. unrestricted), and construct graphs using BERT and sense-enhanced embeddings. Two metrics -- Neighbor Type Probability (NTP) and Neighbor Type Entropy (NTE) -- are proposed to analyze neighborhood type distributions. Results show that graphs constructed with sense-enhanced embeddings reflect semantic type information better, and matching and mismatch sentences can be distinguished through the proposed metrics.
arXiv:2605.23705v1 Announce Type: new
Abstract: The Game Description Language (GDL) is a widely used formalism for specifying general games. Due to their similar syntax and semantics, Answer Set Programming (ASP) and its extensions have been applied to single- and two-player deterministic turn-taking GDL games. This paper presents the first ASP-based approach for solving two-player turn-taking GDL games with uncertainty. We introduce Stochastic An- swer Set Programming (SQASP) to encode the maximally achievable winning probability for a given player in stochastic GDL games, and develop a translation-based solver that evaluates SQASP programs by converting them to Extended Stochastic Satisfiability. Our empirical results show that the proposed approach is competitive with forward search on small stochastic games and can potentially support general game players in endgame evaluation.
arXiv:2502.07489v2 Announce Type: replace
Abstract: State-of-the-art methods for forecasting irregularly sampled time series with missing values predominantly rely on just four datasets and a few small toy examples for evaluation. While ordinary differential equations (ODE) are the prevalent models in science and engineering, a baseline model that forecasts a constant value outperforms ODE-based models from the last five years on three of these existing datasets. This unintuitive finding hampers further research on ODE-based models, a more plausible model family. In this paper, we develop a methodology to generate irregularly sampled multivariate time series (IMTS) datasets from ordinary differential equations and to select challenging instances via rejection sampling. Using this methodology, we create Physiome-ODE, a large and sophisticated benchmark of IMTS datasets consisting of 50 individual datasets, derived from real-world ordinary differential equations from research in biology. Physiome-ODE is the first benchmark for IMTS forecasting that we are aware of and an order of magnitude larger than the current evaluation setting of four datasets. Using our benchmark Physiome-ODE, we show qualitatively completely different results than those derived from the current four datasets: on Physiome-ODE ODE-based models can play to their strength and our benchmark can differentiate in a meaningful way between different IMTS forecasting models. This way, we expect to give a new impulse to research on ODE-based time series modeling.
arXiv:2605.23643v1 Announce Type: new
Abstract: Tools like Tamarin and ProVerif have achieved notable success in analyzing and verifying complex real-world protocols such as EMV, 5G, and WPA2, even detecting zero-day exploits. Despite these successes, verifying such protocols remains a time-consuming, challenging task, often requiring significant human effort and expertise. In this paper, we present a reinforcement learning (RL) framework inspired by AlphaZero and AlphaProof that implements a new style of proof search for Tamarin. We have developed a stateless API for Tamarin that acts as a classical RL environment. We guide a Monte Carlo Tree Search (MCTS) by a neural heuristic that learns from completed subproofs. We evaluate our framework on 16 case studies, ranging from classical protocol models to challenging state-of-the-art protocol models from recent publications. Our method finds more proofs automatically than Tamarin's standard search and produces shorter proofs than both the standard and human-engineered heuristics. Our pipeline is applicable out of the box to assist Tamarin users in active research, reducing the human effort required. Moreover, our standardized interface provides a programmatic way for users to interact with Tamarin. Finally, our work demonstrates the promising potential of adapting RL-based methods to the Tamarin domain.
arXiv:2502.07295v2 Announce Type: replace
Abstract: Neural Networks (NNs) for causal effect estimation have shown strong empirical performance, yet endowing them with desirable semiparametric properties -- doubly robustness and fast convergence rates -- remains challenging. A common approach to address this is targeted regularization, which modifies the objective function of NNs. However, existing work on neural causal effect estimation is largely limited to continuous outcomes, restricting its applicability to settings involving binary, count, or other skewed outcomes commonly encountered in practice. We propose a unified targeted regularization framework for the Exponential Dispersion Family (EDF) to address this limitation. Specifically, we first derive the von Mises expansion of the average dose function of canonical functions (ADCF) for discrete treatments and of the sieve-projected ADCF for continuous treatments. Second, we use this expansion to construct a unified targeted regularization, that corrects first-order bias at the distributional level. We integrate this objective into a NN architecture that jointly estimates the outcome model, propensity score model, and fluctuation parameter end-to-end. Experimental results demonstrate the effectiveness of our method.
arXiv:2605.23630v1 Announce Type: new
Abstract: In this work, we present a systematic study of this trade-off from a deployment-centric perspective, focusing on an autonomous driving scenario. Instead of treating overlay and customized acceleration as isolated design points, we analyze when each approach is preferable under practical conditions, including workload variation, architectural design, reconfiguration latency, and switching frequency. Our analysis shows that overlay-based architecture is more suitable for highly frequent model switching under the state-of-the-art architecture. However, as bitstream reload overhead continues to reduce, customized architectures may become increasingly attractive, especially for workloads with efficiency requirements. Conversely, if overlay architectures become more capable and flexible, they may further expand their advantage over customized architectures. These observations provide design insights for future architectural design, and the optimal deployment strategy will be flipped according to the technique development.
STEC-Net: A Spatiotemporal Graph Neural Framework for Community Discovery in Dynamic Social Networks
arXiv:2501.12208v5 Announce Type: replace
Abstract: Community discovery is a central problem in the analysis of dynamic social networks. Traditional community discovery methods mainly focus on the formation and dissolution of links between nodes, and therefore often fail to capture the richer spatial structure and temporal dependency underlying network evolution. To address this limitation, we propose STEC-Net, a spatiotemporal graph neural framework for community discovery in dynamic social networks. STEC-Net integrates spatial structure and temporal dynamics within a unified embedding architecture. First, Graph Convolutional Networks (GCNs) are used to learn snapshot-level node representations from network topology. To adapt the spatial encoder to structural evolution, a GRU-based weight evolution mechanism is introduced to update the GCN parameters over time. Then, a second Gated Recurrent Unit (GRU) is employed to model temporal dependencies across snapshot embeddings and to learn spatiotemporal node representations. Finally, a Self-Organizing Map (SOM) is applied to the learned embeddings to cluster nodes and infer their community affiliations. Experiments on four types of dynamic networks show that STEC-Net consistently outperforms traditional community discovery methods in terms of purity, normalized mutual information, homogeneity, and completeness. These results demonstrate that STEC-Net can effectively uncover evolving community structures in dynamic social networks.
arXiv:2412.00936v5 Announce Type: replace
Abstract: Forecast verification plays a crucial role in the development cycle of operational numerical weather prediction models. At the same time, verification remains a challenge as the traditionally used non-spatial forecast quality metrics exhibit certain drawbacks, with new spatial metrics being developed to address these problems. Some of these new metrics are based on smoothing, with one example being the widely used Fraction Skill Score (FSS) and its many derivatives. However, while the FSS has been used by many researchers in limited area domains, there are no examples of it being used in a global domain yet. The issue is due to the increased computational complexity of smoothing in a global domain, with its inherent spherical geometry and non-equidistant and/or irregular grids. At the same time, there clearly exists a need for spatial metrics that could be used in the global domain as the operational global models continue to be developed and improved, along with the new machine-learning-based models. Here, we present two new methodologies for smoothing in a global domain that are potentially fast enough to make the smoothing of high-resolution global fields feasible. Both approaches also consider the variability of grid point area sizes and can handle missing data appropriately. This, in turn, makes the calculation of smoothing-based metrics, such as FSS and its derivatives, in a global domain possible, which we demonstrate by evaluating the performance of operational high-resolution global precipitation forecasts provided by the European Centre for Medium-Range Weather Forecasts.
arXiv:2605.22981v1 Announce Type: new
Abstract: Fill-in-the-middle (FIM) is a pretraining objective widely used to equip causal language models with infilling ability, yet its effect on verbatim memorization remains underexplored. We study the memorization dynamics of FIM in a controlled setting by pretraining matched Llama 3.2 models with FIM and standard left-to-right (LTR) objectives on a FineWeb-Gutenberg corpus containing repeated Gutenberg excerpts. With prefix-based probes, FIM more often recovers short or partially matching spans, while LTR more often assigns high confidence to long exact continuations. We observe that verbatim extraction under FIM-training grows approximately linearly with repetitions over the tested range. Evaluating native FIM-format probes reveals that suffix context is not sufficient: verbatim recall under FIM-training remains strongly anchored in prefix context. Our results also show that evaluating only one span length or probing format can miss important nuances in memorization behavior.
arXiv:2605.22982v1 Announce Type: new
Abstract: Taylor--Aris dispersion of Brownian rods in non-circular ducts is governed by a coupling absent from passive-scalar theory. Pressure-driven shear aligns the rods and makes translational diffusion tensorial, while duct geometry determines how this tensor is sampled across the cross-section. We formulate this problem for dilute rods in regular-polygonal ducts of arbitrary side number. At each cross-sectional point, a local shear-aligned Jeffery--Brownian closure gives four transport fields, namely two transverse diffusivities, a direct axial diffusivity and a signed shear--axial cross coefficient. Because the shear frame rotates through a polygon, these fields enter a conservative two-dimensional transverse operator rather than a radial scalar-diffusion problem. Its zero mode is a non-uniform invariant density, which replaces the area measure in the Taylor--Aris reduction and reduces, in the circular-pipe limit, to a weighting proportional to the inverse shear-direction diffusivity.
The resulting cell problem separates the effects of rod alignment on streamline sampling and transverse relaxation. Alignment produces only a small, non-monotone shift in mean speed, but gives a larger enhancement of the Taylor coefficient by reducing transverse mixing. Normalization by the same-geometry spherical coefficient removes most passive shape dependence and exposes the approach to the fully aligned transverse-mixing limit. Finite regular polygons converge smoothly to the circular-pipe branch, whereas low-sided polygons retain distinct shear-sampling signatures. A biorthogonal spectral formulation resolves finite-time releases. Localized, multi-peaked and broad injections excite different non-zero transverse modes and exhibit different pre-asymptotic variance growth, but modal decay selects the common long-time Taylor--Aris coefficient given by the cell problem.
arXiv:2605.22984v1 Announce Type: new
Abstract: Test-Time Training (TTT) is an emerging paradigm that enables models to adapt their parameters during inference, improving performance on tasks such as few-shot learning, retrieval-augmented generation, and complex reasoning. However, this dynamic adaptation introduces new vulnerabilities that adversaries can exploit to jailbreak models. We identify three threat models for TTT and demonstrate how attackers can leverage them to bypass safety filters. Our results show that TTT can significantly increase the Attack Success Rate (ASR) and the ASR over 10 generation trials (ASR@10). For example, under LoRA, the few-shot and generation-phase threat models achieve an average ASR@10 of 95% and 93% respectively, across models from different families and scales. These vulnerabilities transfer to production fine-tuning APIs. We also show that TTT-induced overfitting can produce degenerate outputs that inflate ASR under standard judges, and propose a validity-aware evaluation to correct for this. Our findings suggest that TTT exposes a new attack surface, strengthens attacks, and undermines existing safety guardrails. As a first step toward defense, we propose a lightweight provider-side detector that flags TTT requests via the perplexity shift on a private harmful holdout, but robust deployment will ultimately require dynamic alignment.
arXiv:2605.22986v1 Announce Type: new
Abstract: Learning reward functions from demonstrations assumes that demonstrations provide adequate supervision over all features -- or task-relevant aspects of behavior. In practice, demonstrations are often imperfect: humans may under-emphasize certain features due to cognitive load or physical difficulty, or the training regime may fail to sufficiently cover all relevant situations. In either case, important features may be underspecified, leading to ambiguity in the learned reward function and misaligned behavior at deployment. We propose a framework that detects such underspecified features and actively solicits targeted corrective demonstrations. Our key insight is that demonstrations implicitly reveal which features are well specified: features that are consistently optimized show little variation across demonstrations, while features that are underspecified vary widely. We leverage this statistical signal to infer which features may have been insufficiently demonstrated. The robot then explains which features it is uncertain about in natural language and queries for demonstrations that explicitly address the identified gaps. We evaluate our approach in a simulated tabletop manipulation domain and in a user study with a real Franka robot. Targeted, explanation-guided queries significantly improve reward recovery compared to random querying and passive data collection, reducing ambiguity that would otherwise persist in learning from imperfect demonstrations.
arXiv:2605.23023v1 Announce Type: new
Abstract: In orchestrated multi-agent systems, humans often struggle to manage plans due to their complexity and limited transparency. Existing approaches rely on outcome-level supervision, where users verify only final outputs without visibility into intermediate reasoning. We formalize a design space for human-LLM co-planning interactions along three axes: mode (semantic vs. structural), scope (global vs. targeted), and level (low vs. high-level edits). We realize it in AMBIPOM, a prototype supporting process-level supervision through both semantic and structural interactions. Through a user study, we characterize how users navigate this space, revealing hybrid workflows and effort-control-risk trade-offs; through a controlled benchmark, we analyze how LLMs revise plans under varying scope and revision strategies. Our findings yield design insights for more transparent, controllable, and effective human-AI co-planning. We release code and data at https://github.com/megagonlabs/ambipom.
arXiv:2605.23025v1 Announce Type: new
Abstract: World models represent a paradigm shift in generative AI, pursuing predictive understanding and controllable simulation of environments in a structured and generalizable way. We present World Machine, a generative world-modeling architecture for time series. It is a transformer-based architecture with latent states that enables adaptation to different amounts of observed data and contexts. This shows an improvement over traditional transformers, which have a computational and memory cost that scales quadratically with the context. Experiments on a proposed synthetic dataset, Toy1D, validate the approach's feasibility, demonstrate capabilities not found in conventional transformers, and highlight the contributions of each component of the training protocol.
EM-Vid: Training-Free Entity-Centric Memory for Efficient and Consistent Multi-Shot Video Generation
arXiv:2605.23610v1 Announce Type: new
Abstract: Multi-shot video generation requires maintaining a consistent appearance of recurring entities across shots while remaining faithful to shot-specific text prompts. Recent autoregressive methods reuse previously generated frames as memory. However, full-frame storage entangles persistent entity information with transient scene context, leading to irrelevant information leakage and high computational cost. We propose an entity-centric memory in the form of an entity-indexed bank of latent patches. We introduce sparse token conditioning compatible with pretrained models, restricting self-attention to entity-relevant tokens and reducing computational cost. To support this, we introduce a structured multi-shot script format. We additionally propose a budgeted memory update strategy to maintain a compact, evolving memory. Finally, we equip the entity representation with a noise-injection mechanism that enables fine-grained appearance control, preventing leakage of irrelevant information. Our method improves prompt adherence and efficiency while preserving subject consistency.
arXiv:2406.02883v2 Announce Type: replace
Abstract: Automated scraping stands out as a common method for collecting data in deep learning models without the authorization of data owners. Recent studies have begun to tackle the privacy concerns associated with this data collection method. Notable approaches include Deepconfuse, error-minimizing, error-maximizing (also known as adversarial poisoning), Neural Tangent Generalization Attack, synthetic, autoregressive, One-Pixel Shortcut, Self-Ensemble Protection, Entangled Features, Robust Error-Minimizing, Hypocritical, and TensorClog. The data generated by those approaches, called "unlearnable" examples, are prevented "learning" by deep learning models. In this research, we investigate and devise an effective nonlinear transformation framework and conduct extensive experiments to demonstrate that a deep neural network can effectively learn from the data/examples traditionally considered unlearnable produced by the above twelve approaches. The resulting approach improves the ability to break unlearnable data compared to the linear separable technique recently proposed by researchers. Specifically, our extensive experiments show that the improvement ranges from 0.34% to 249.59% for the unlearnable CIFAR10 datasets generated by those twelve data protection approaches, except for One-Pixel Shortcut. Moreover, the proposed framework achieves over 100% improvement of test accuracy for Autoregressive and REM approaches compared to the linear separable technique. Our findings suggest that these approaches are inadequate in preventing unauthorized uses of data in machine learning models. There is an urgent need to develop more robust protection mechanisms that effectively thwart an attacker from accessing data without proper authorization from the owners.
arXiv:2605.23027v1 Announce Type: new
Abstract: Recent research has demonstrated the potential of reinforcement learning in effective multi-robot collaboration, particularly in social dilemmas where robots face a trade-off between self-interest and collective benefits. However, environmental factors such as miscommunication and adversarial robots can impact cooperation, making it crucial to explore how multi-robot communication can be manipulated to achieve different outcomes. This paper presents PIMbot, a framework that manipulates outcomes via two complementary levers: (i) incentive manipulation of the reward channel and (ii) policy manipulation of an agent's own actions. An adaptive multi-objective controller balances these levers in an online manner. Our work introduces a novel approach to manipulation in recent multi-agent RL social dilemmas that utilize a unique reward function for incentivization. By utilizing our proposed PIMbot mechanisms, a robot is able to manipulate the social dilemma environment effectively. Comprehensive experimental results demonstrate the effectiveness of our proposed methods in the Gazebo-simulated multi-robot environment. Moreover, a real embedded device case study on NVIDIA Jetson Orin Nano quantifies system cost and validates PIMbot's effectiveness on realistic autonomous embedded systems scenarios beyond simulation. Together, these results position PIMbot as a rigorous stress-test tool exposing critical vulnerabilities in multi-robot cooperative tasks.
arXiv:2605.23028v1 Announce Type: new
Abstract: Machine learning methods rely on data. However, gathering suitable data can be challenging due to availability constraints, cost, or the need for domain expertise. Expanding datasets with additional sources is a common response to limited data, yet this practice does not always improve downstream performance and can sometimes lead to a loss of performance, known as negative transfer. We propose RADAR, a simple, geometrically grounded metric for estimating cross-domain transferability in foundation models. RADAR analyzes the layer-wise evolution of representations by measuring angular alignments and relative changes in distance along layer-to-layer displacement trajectories, and by comparing empirical distributions of within-domain and cross-domain dynamics. We hypothesize that domain transferability is related to the divergence between these trajectory distributions. We evaluate the metric across multiple modalities, including cross-lingual sentiment classification with text embedding models and cross-domain image classification with foundation vision models. Across several settings, RADAR provides competitive predictive performance relative to existing transferability metrics on several vision and text benchmarks, with particularly strong results when domain transitions are smooth or cleanly separated. Our ablations further suggest that the effectiveness of transferability estimation depends on the geometry of the model's internal representation space, with different modalities favoring different topological formulations.
arXiv:2402.17888v5 Announce Type: replace
Abstract: Post-hoc out-of-distribution (OOD) detection has garnered intensive attention in reliable machine learning. Many efforts have been dedicated to deriving score functions based on logits, distances, or rigorous data distribution assumptions to identify low-scoring OOD samples. Nevertheless, these estimate scores may fail to accurately reflect the true data density or impose impractical constraints. To provide a unified perspective on density-based score design, we propose a novel theoretical framework grounded in Bregman divergence, which extends distribution considerations to encompass an exponential family of distributions. Leveraging the conjugation constraint revealed in our theorem, we introduce a \textsc{ConjNorm} method, reframing density function design as a search for the optimal norm coefficient $p$ against the given dataset. In light of the computational challenges of normalization, we devise an unbiased and analytically tractable estimator of the partition function using the Monte Carlo-based importance sampling technique. Extensive experiments across OOD detection benchmarks empirically demonstrate that our proposed \textsc{ConjNorm} has established a new state-of-the-art in a variety of OOD detection setups, outperforming the current best method by up to 13.25$\%$ and 28.19$\%$ (FPR95) on CIFAR-100 and ImageNet-1K, respectively.
arXiv:2605.23030v1 Announce Type: new
Abstract: With recent developments in offshore grid architectures, power park modules (PPMs) such as clusters of offshore wind power plants (OWPPs) are increasingly interconnected offshore. Consequently, it is necessary to assess how integrating a new OWPP affects the stability margins of an existing OWPP at the point of connection. Although impedance-based methods are widely used for small-signal stability assessment of interconnected converter-based systems, many studies rely primarily on Nyquist encirclements and do not explicitly quantify stability margins. Thus, this paper proposes a general impedance-based methodology to (i) evaluate the stability margins of an existing connection after a new PPM is integrated and (ii) derive a maximum allowable impedance for the new connection such that the minimum stability margin requirements specified by system operators are satisfied and stable operation is maintained. In addition, new Nyquist-based stability regions are introduced to complement the generalized Nyquist criterion, providing analytical indications of margin compliance and headroom. The proposed method is validated through case studies using vendor-based frequency-domain models of two interconnected OWPPs and HVDC system.
arXiv:2605.23051v1 Announce Type: new
Abstract: Photonic computing offers a promising route to accelerating artificial intelligence (AI) by providing high analog bandwidth, low latency, and low energy consumption. However, existing optical neural networks (ONNs) struggle with substantial hardware overhead and limited support for the dynamic, arbitrary matrix operations essential for modern AI architectures. Here we present the dynamic universal encoding tensorcore (DUET), a general-purpose photonic computing paradigm based on vectorized operand differential interferometric cells (VODICs). By exploiting inherent structural symmetry, this design provides a full-range linear encoding interface that directly accommodates signed operands. This approach eliminates the sign-based path splitting, nonlinear remapping, and auxiliary preprocessing typically required in conventional ONNs, thereby reducing latency and minimizing hardware and memory overhead. We further implement a hardware-aware training (HAT) strategy to alleviate the impact of on-chip non-idealities and ensure stable inference. DUET is experimentally validated across diverse architectures and application domains, ranging from image classification and medical segmentation to Transformer-based content generation, demonstrating competitive performance. By extending optical computing to universal, full-range operators across diverse model architectures, DUET provides a viable pathway toward general-purpose optical acceleration for contemporary AI workloads.
arXiv:2212.06054v3 Announce Type: replace
Abstract: There have been three geometrizations in history. The first one is historically due to the Pythagorean school and Plato, the second one comes from Galileo, Kepler, Descartes and Newton, and the third geometrization of nature begins with Einstein's general relativity. Here the term geometrization of nature means the conception according to which nature (with its different meanings) is largely described by using geometry. In this article, I focus on the third geometrization, in which the black hole shadow phenomenon relates shape to dynamics. As a consequence, spacetime symmetry could play the role of the formal cause in black hole physics. Spacetime symmetry as formal cause of spacetime could be an interesting point in the kinematics-dynamics debate in the theory of relativity.
arXiv:2605.23864v1 Announce Type: cross
Abstract: In industrial scenarios involving multi-agent collective decision-making, centralized decision-making may not be admissible due to restrictive access to individual local information, while the conflicts between participants' self-interest and global performance may also impede collaborative distributed decision-making. This paper proposes a mechanism-driven distributed decision-making method, wherein incentives are employed and designed to motivate participants to collaborate in a distributed fashion even though each participant's decision is driven primarily by self-interest. Focusing on optimization problems with coupled objective functions and coupled constraints, we design a distributed optimization algorithm tailored for this class of problems and provide guarantees for its convergence. Furthermore, we design two incentive mechanisms, the shadow pricing mechanism and the Vickrey-Clarke-Groves mechanism, and demonstrate that participants are willing to engage in distributed collaboration under these mechanisms. The mechanism drives the execution of the distributed algorithm, and the optimal result of distributed computation guides the determination of incentives in the mechanism, both of which are interrelated to form a closed loop. Finally, numerical experiments illustrate the effectiveness of the proposed algorithm and mechanisms.
arXiv:2605.23139v1 Announce Type: new
Abstract: Multivariate time series anomaly detection has become increasingly important in real-world applications, where labeled data are often scarce. Many existing approaches rely on unsupervised learning to model normal patterns, but they often treat all channels equally. This design can dilute anomaly-relevant signals, since not all channels contribute equally to anomaly detection. In this paper, we propose CALAD, a channel-aware contrastive learning framework for multivariate time series anomaly detection. CALAD governs the construction of contrastive samples using estimated channel relevance, allowing the learning process to reflect anomaly semantics rather than generic similarity. Channel relevance is estimated from reconstruction errors of a transformer-based autoencoder and is used to distinguish channels that are more influential to anomalous behaviors. Using this information, we design a channel-wise augmentation strategy in which positive and negative samples are constructed based on whether anomaly-relevant channels are preserved or perturbed. This encourages invariance to changes in irrelevant channels while being sensitive to changes in anomaly-relevant channels. Furthermore, CALAD combines contrastive learning and an auxiliary reconstruction head, allowing the model to learn discriminative representations while retaining normal structures. Experiments on multiple real-world datasets shows that CALAD consistently outperforms existing methods, particularly under distribution shift scenarios. We provide the code for reproducibility at https://github.com/hirundo1218/CALAD