The Kochen Specker theorem revealed contextuality as a fundamental nonclassical feature of nature. Nonlocality arises as a special case of contextuality, where entangled states shared by space like separated parties exhibit nonlocal correlations. The notion of maximality in correlations, analogous to maximal entanglement, is less explored in multipartite systems. In our work, we have defined maximal correlations in terms of contextual models, which are analogous to absolutely maximally entangled (AME) states. Employing the sheaf theoretic framework, we introduce maximal contextual correlations associated with the corresponding maximal contextual model. The formalism introduces the contextual fraction CF as a measure of contextuality, taking values from 0 (noncontextual) to 1 (fully contextual). This enables the formulation of a new class of correlations termed absolutely maximal contextual correlations (AMCC), which are both maximally contextual and maximal marginals. In the bipartite setting, the canonical example is the Popescu Rohrlich (PR) box, while in the tripartite case, it includes Greenberger Horne Zeilinger (GHZ) correlations and three way nonlocal correlations. In this w
Quantum contextuality is a concept used to describe the property of hidden-variable theory that measurement outcomes predetermined by the hidden variables depend on the measurement context. The term measurement context can have different meanings, giving rise to different flavours of quantum contextuality. The first discovered flavour is Kochen-Specker (KS) contextuality where measurement outcomes will depend on what compatible measurements are jointly performed with the selected measurement. Another flavour, here to be compared with KS contextuality, is that referred to in Bohmian mechanics where outcomes of some specific measurements are not completely specified by the model state, but depend also on specifics of the measurement device used. It has been claimed that this type of Bohmian contextuality is necessary to enable KS contextuality in a hidden variable model. In this paper we show that this is not the case. The recently proposed Contextual Ontological Model (COM) [Hindlycke and Larsson, Phys. Rev. Lett. 2022] produces KS contextual predictions but does not have the Bohmian contextuality; the outcome of every measurement allowed by COM can be predicted from the model state
Contextuality is a fundamental manifestation of nonclassicality, indicating that for certain quantum correlations, sets of jointly measurable variables cannot be pre-assigned values independently of the measurement context. In this work, we characterize nonclassical quantum correlation beyond contextuality, in terms of supernoncontextuality, namely the higher-than-quantum hidden-variable(HV) dimensionality required to reproduce the given noncontextual quantum correlations. Thus supernoncontextuality is the contextuality analogue of superlocality. Specifically, we study the quantum system of two-qubit states in a scenario composed of five contexts that demonstrate contextuality in a state-dependent fashion. For this purpose, we use the framework of boxes, whose behavior is described by a set of probabilities satisfying the no-disturbance conditions. We first demonstrate that while superlocality is necessary to observe a contextual box, superlocality is not sufficient for contextuality. On the other hand, a noncontextual superlocal box can be supernoncontextual, but superlocality is not a necessary condition. We then introduce a notion of nonclassicality beyond the standard contextua
Fully revealing the mathmatical structure of quantum contextuality is a significant task, while some known contextuality theories are only applicable for rank-1 projectors. That is because they adopt the observable-based definitions. This paper overcomes the challenges faced by some known contextuality theories by establishing an event-based contextuality theory with exclusive partial Boolean algebra, which is used to describe the contextual systems with local consistency and exclusivity principle. Our theory provides a precise mathematical framework for quantum contextuality, which can handle the scenarios composed of general projectors, and introduces a more complete contextuality hierarchy. We conclude that the Kochen-Specker contextuality is equivalent to the state-independent strong contextuality for finite dimensional quantum systems. Therefore, when considering both the strength and proportion of contextual quantum states, Kochen-Specker contextuality is the strongest.
Multimodal large language models (MLLMs) are increasingly deployed as assistants that interact through text and images, making it crucial to evaluate contextual safety when risk depends on both the visual scene and the evolving dialogue. Existing contextual safety benchmarks are mostly single-turn and often miss how malicious intent can emerge gradually or how the same scene can support both benign and exploitative goals. We introduce the Multi-Turn Multimodal Contextual Safety Benchmark (MTMCS-Bench), a benchmark of realistic images and multi-turn conversations that evaluates contextual safety in MLLMs under two complementary settings, escalation-based risk and context-switch risk. MTMCS-Bench offers paired safe and unsafe dialogues with structured evaluation. It contains over 30 thousand multimodal (image+text) and unimodal (text-only) samples, with metrics that separately measure contextual intent recognition, safety-awareness on unsafe cases, and helpfulness on benign ones. Across eight open-source and seven proprietary MLLMs, we observe persistent trade-offs between contextual safety and utility, with models tending to either miss gradual risks or over-refuse benign dialogues.
Multimodal document retrieval aims to retrieve relevant pages while preserving both textual and visual content from the original document. However, existing benchmarks primarily evaluate simple lexical or semantic matching, and most methods encode pages independently. Consequently, they overlook the contextual information in the document required to resolve queries that aggregate information across multiple pages. In this paper, we introduce CMDR and CMDR-Bench, a new multimodal document retrieval task and benchmark that require modeling document context. To address this challenge, we propose CMDR-Embed, a contextual multimodal embedding framework that explicitly incorporates document context by jointly encoding multiple pages and deriving page-level embeddings from a shared contextual representation. Furthermore, we introduce CMCL, a contextual multimodal contrastive learning objective that effectively trains CMDR-Embed by balancing contextual modeling with page-level discriminability. Experiments demonstrate that CMDR-Embed significantly outperforms non-contextual embeddings, highlighting the importance of context-aware multimodal embeddings for advancing document retrieval.
Contextuality is a central feature of quantum theory, traditionally understood as the impossibility of reproducing quantum measurement statistics using noncontextual ontological models. We study classical ontological descriptions in which a fixed subsystem-level ontic state space is reused across multiple interventions. Our main result is an information-theoretic obstruction: whenever a classical single-state model reproduces operational statistics using an auxiliary contextual register, the required contextual information is lower-bounded by the conditional mutual information $I(C;O\mid λ)$ between intervention $C$ and outcome $O$ conditioned on the subsystem ontic state $λ$. The mathematical inequality itself is elementary, but its interpretive significance is structural: under shared-state reuse, contextual distinctions need not be fully internalized within the subsystem ontic state alone. We provide a constructive illustration of this point and clarify how the issue should be understood as a limitation of subsystem-level classical representation, rather than as a dualism about physical reality. We further discuss how this perspective relates to ontological models and to context
Transformer architectures have achieved remarkable empirical success in modeling contextual relations, yet a clear understanding of their expressive power is still lacking. In this work, we introduce a measure-theoretic framework in which contextual relations are modeled as probabilistic objects, either as conditional distributions or as joint distributions (couplings). This perspective reveals a natural connection between standard softmax attention and entropy-regularized optimal transport, providing a unified view of attention as a normalization of an underlying affinity function. Within this framework, we establish a universal approximation theorem for contextual systems using standard Softmax Attention and alternately Sinkhorn normalization. These results show that Transformer architectures can approximate arbitrary contextual relations rules, and that the choice of normalization determines how these relations are represented. Moreover, they provide a principled explanation for why Transformers are effective at modeling contextual relations.
The contextual fraction introduced by Abramsky and Brandenburger defines a quantitative measure of contextuality associated with empirical models, i.e. tables of probabilities of measurement outcomes in experimental scenarios. In this paper we define an entanglement monotone relying on the contextual fraction. We first show that any separable state is necessarily non-contextual with respect to any Bell scenario. Then, for 2-qubit states, we associate a state-dependent Bell scenario and show that the corresponding contextual fraction is an entanglement monotone, suggesting contextuality may be regarded as a refinement of entanglement. We call this monotone the quarter-turn contextual fraction (QTCF), and use it to set an upper bound of approximately 0.601 for the minimum entanglement entropy needed to guarantee contextuality with respect to some Bell scenario.
The Heisenberg microscope provides a powerful mental image of the measurement process of quantum mechanics (QM), attempting to explain the uncertainty relation through an uncontrollable back-action from the measurement device. However, Heisenberg's proposed back-action uses features that are not present in the QM description of the world, and according to Bohr not present in the world. Therefore, Bohr argues, the mental image proposed by Heisenberg should be avoided. Later developments by Bell and Kochen-Specker shows that a model that contains the features used for the Heisenberg microscope is in principle possible but must necessarily be nonlocal and contextual. In this paper we will re-examine the measurement process within a restriction of QM known as Stabilizer QM (SQM), that still exhibits for example Greenberger-Horne-Zeilinger nonlocality and Peres-Mermin contextuality. The re-examination will use a recent extension of SQM, the Contextual Ontological Model (COM), where the system state gives a complete description of future measurement outcomes reproducing the quantum predictions, including the mentioned phenomena. We will see that the resulting contextual Heisenberg micros
The problem of designing codes for deletion-correction and synchronization has received renewed interest due to applications in DNA-based data storage systems that use nanopore sequencers as readout platforms. In almost all instances, deletions are assumed to be imposed independently of each other and of the sequence context. These assumptions are not valid in practice, since nanopore errors tend to occur within specific contexts. We study contextual nanopore deletion-errors through the example setting of deterministic single deletions following (complete) runlengths of length at least $k$. The model critically depends on the runlength threshold $k$, and we examine two regimes for $k$: a) $k=C\log n$ for a constant $C\in(0,1)$; in this case, we study error-correcting codes that can protect from a constant number $t$ of contextual deletions, and show that the minimum redundancy (ignoring lower-order terms) is between $(1-C)t\log n$ and $2(1-C)t\log n$, meaning that it is a ($1-C$)-fraction of that of arbitrary $t$-deletion-correcting codes. To complement our non-constructive redundancy upper bound, we design efficiently and encodable and decodable codes for any constant $t$. In part
Large Multimodal Models (LMMs) are increasingly applied to meal images for nutrition analysis. However, existing work primarily evaluates proprietary models, such as GPT-4. This leaves the broad range of LLMs underexplored. Additionally, the influence of integrating contextual metadata and its interaction with various reasoning modifiers remains largely uncharted. This work investigates how interpreting contextual metadata derived from GPS coordinates (converted to location/venue type), timestamps (transformed into meal/day type), and the food items present can enhance LMM performance in estimating key nutritional values. These values include calories, macronutrients (protein, carbohydrates, fat), and portion sizes. We also introduce \textbf{ACETADA}, a new food-image dataset slated for public release. This open dataset provides nutrition information verified by the dietitian and serves as the foundation for our analysis. Our evaluation across eight LMMs (four open-weight and four closed-weight) first establishes the benefit of contextual metadata integration over straightforward prompting with images alone. We then demonstrate how this incorporation of contextual information enhan
Modern Text-to-Image (T2I) diffusion models have achieved remarkable semantic alignment, yet they often suffer from a significant lack of variety, converging on a narrow set of visual solutions for any given prompt. This typicality bias presents a challenge for creative applications that require a wide range of generative outcomes. We identify a fundamental trade-off in current approaches to diversity: modifying model inputs requires costly optimization to incorporate feedback from the generative path. In contrast, acting on spatially-committed intermediate latents tends to disrupt the forming visual structure, leading to artifacts. In this work, we propose to apply repulsion in the Contextual Space as a novel framework for achieving rich diversity in Diffusion Transformers. By intervening in the multimodal attention channels, we apply on-the-fly repulsion during the transformer's forward pass, injecting the intervention between blocks where text conditioning is enriched with emergent image structure. This allows for redirecting the guidance trajectory after it is structurally informed but before the composition is fixed. Our results demonstrate that repulsion in the Contextual Spa
This paper considers a contextual bandit problem involving multiple agents, where a learner sequentially observes the contexts and the agent's reported arms, and then selects the arm that maximizes the system's overall reward. Existing work in contextual bandits assumes that agents truthfully report their arms, which is unrealistic in many real-life applications. For instance, consider an online platform with multiple sellers; some sellers may misrepresent product quality to gain an advantage, such as having the platform preferentially recommend their products to online users. To address this challenge, we propose an algorithm, COBRA, for contextual bandit problems involving strategic agents that disincentivize their strategic behavior without using any monetary incentives, while having incentive compatibility and a sub-linear regret guarantee. Our experimental results also validate the different performance aspects of our proposed algorithm.
This paper proposes a novel approach to semantic ontology alignment using contextual descriptors. A formalization was developed that enables the integration of essential and contextual descriptors to create a comprehensive knowledge model. The hierarchical structure of the semantic approach and the mathematical apparatus for analyzing potential conflicts between concepts, particularly in the example of "Transparency" and "Privacy" in the context of artificial intelligence, are demonstrated. Experimental studies showed a significant improvement in ontology alignment metrics after the implementation of contextual descriptors, especially in the areas of privacy, responsibility, and freedom & autonomy. The application of contextual descriptors achieved an average overall improvement of approximately 4.36%. The results indicate the effectiveness of the proposed approach for more accurately reflecting the complexity of knowledge and its contextual dependence.
In the dynamic landscape of online businesses, recommender systems are pivotal in enhancing user experiences. While traditional approaches have relied on static supervised learning, the quest for adaptive, user-centric recommendations has led to the emergence of the formulation of contextual bandits. This tutorial investigates the contextual bandits as a powerful framework for personalized recommendations. We delve into the challenges, advanced algorithms and theories, collaborative strategies, and open challenges and future prospects within this field. Different from existing related tutorials, (1) we focus on the exploration perspective of contextual bandits to alleviate the ``Matthew Effect'' in the recommender systems, i.e., the rich get richer and the poor get poorer, concerning the popularity of items; (2) in addition to the conventional linear contextual bandits, we will also dedicated to neural contextual bandits which have emerged as an important branch in recent years, to investigate how neural networks benefit contextual bandits for personalized recommendation both empirically and theoretically; (3) we will cover the latest topic, collaborative neural contextual bandits,
In this paper, we define a generalization of indexed categories and contextual categories which we call contextually indexed (contextual) categories. While contextual categories are models of ordinary type theories, contextually indexed (contextual) categories are models of indexed type theories. We also define type-theoretic semi-fibration categories which generalize type-theoretic fibration categories. Every model category in which cofibrations are stable under pullbacks is a type-theoretic semi-fibration category. We show that type-theoretic semi-fibration category gives rise to a contextually indexed contextual category with finite limits. Finally, we prove that the category of simplicial sets with the Joyal model structure gives rise to a locally small Cartesian closed contextually indexed contextual category with indexed limits and colimits.
Co-speech gesture generation is crucial for creating lifelike avatars and enhancing human-computer interactions by synchronizing gestures with speech. Despite recent advancements, existing methods struggle with accurately identifying the rhythmic or semantic triggers from audio for generating contextualized gesture patterns and achieving pixel-level realism. To address these challenges, we introduce Contextual Gesture, a framework that improves co-speech gesture video generation through three innovative components: (1) a chronological speech-gesture alignment that temporally connects two modalities, (2) a contextualized gesture tokenization that incorporate speech context into motion pattern representation through distillation, and (3) a structure-aware refinement module that employs edge connection to link gesture keypoints to improve video generation. Our extensive experiments demonstrate that Contextual Gesture not only produces realistic and speech-aligned gesture videos but also supports long-sequence generation and video gesture editing applications, shown in Fig.1.
We present SmartCourse, an integrated course management and AI-driven advising system for undergraduate students (specifically tailored to the Computer Science (CPS) major). SmartCourse addresses the limitations of traditional advising tools by integrating transcript and plan information for student-specific context. The system combines a command-line interface (CLI) and a Gradio web GUI for instructors and students, manages user accounts, course enrollment, grading, and four-year degree plans, and integrates a locally hosted large language model (via Ollama) for personalized course recommendations. It leverages transcript and major plan to offer contextual advice (e.g., prioritizing requirements or retakes). We evaluated the system on 25 representative advising queries and introduced custom metrics: PlanScore, PersonalScore, Lift, and Recall to assess recommendation quality across different context conditions. Experiments show that using full context yields substantially more relevant recommendations than context-omitted modes, confirming the necessity of transcript and plan information for personalized academic advising. SmartCourse thus demonstrates how transcript-aware AI can e
Large language models (LLMs) remain acutely vulnerable to prompt injection and related jailbreak attacks; heuristic guardrails (rules, filters, LLM judges) are routinely bypassed. We present Contextual Integrity Verification (CIV), an inference-time security architecture that attaches cryptographically signed provenance labels to every token and enforces a source-trust lattice inside the transformer via a pre-softmax hard attention mask (with optional FFN/residual gating). CIV provides deterministic, per-token non-interference guarantees on frozen models: lower-trust tokens cannot influence higher-trust representations. On benchmarks derived from recent taxonomies of prompt-injection vectors (Elite-Attack + SoK-246), CIV attains 0% attack success rate under the stated threat model while preserving 93.1% token-level similarity and showing no degradation in model perplexity on benign tasks; we note a latency overhead attributable to a non-optimized data path. Because CIV is a lightweight patch -- no fine-tuning required -- we demonstrate drop-in protection for Llama-3-8B and Mistral-7B. We release a reference implementation, an automated certification harness, and the Elite-Attack co