SearcharxivSearch

arXiv subjects

Sahil Joshi

Publications and source records attributed to Sahil Joshi.

8 recordsLinked to original sources

Inference Time Context Sparsity: Illusion or Opportunity?

Sparsity has long been a central theme in LLM efficiency, but its role in context processing remains unresolved. As LLM workloads shift toward longer contexts and agentic interactions, the compute and memory bottlenecks of attention become increasingly critical, raising the question of whether these constraints are fundamental. Our position is that these constraints are artificial and unnecessary, and that the future of LLM inference lies in extreme but principled sparsity along the context dimension. This position is supported by several strands of empirical and theoretical evidence. First, we find the insistence on dense attention unreasonable, since in a long context a query effectively projects O(N) attention information into a hidden space of dimension d << N, making the process inherently lossy. Second, we perform an extensive study of sparsity in LLMs spanning 20 models across five model families, varying context lengths, and different sparsity levels. We empirically demonstrate a strong trend: current LLMs, despite not being trained for context sparsity, are remarkably robust to inference-time decode sparsity across tasks of varying complexity, including retrieval, multi-hop QA, mathematical reasoning, and agentic coding. Importantly, we also show that current hardware is already sufficient to realize substantial gains from this sparsity. For example, our sparse decode kernels accelerate large-context processing by up to 10x over FlashInfer at 50x sparsity levels on hardware such as the H100. Overall, these results position extreme context sparsity not as a heuristic, but as a principled foundation for LLM inference, training, and architecture design: one that is both feasible and beneficial, and a compelling direction for future systems.

cs.AI

Scout Before You Attend: Sketch-and-Walk Sparse Attention for Efficient LLM Inference

Self-attention dominates the computational and memory cost of long-context LLM inference across both prefill and decode phases. To address this challenge, we introduce Sketch&Walk Attention, a training-free sparse attention method that determines sparsity with lightweight sketches and deterministic walk. Sketch&Walk applies Hadamard sketching to get inexpensive approximations of attention scores, then aggregates these estimates across layers via a walk mechanism that captures attention influence beyond direct interactions between tokens. The accumulated walk scores are used to select top-k attention blocks, enabling dynamic sparsity with a single training-free algorithm that applies uniformly to both the prefill and decode phases, together with custom sparse attention kernels. Across a wide range of models and tasks, Sketch&Walk maintains near-lossless accuracy at 20% attention density and can slightly outperform dense attention in some settings, while achieving up to 6x inference speedup.

cs.LG

SOCKET: SOft Collision Kernel EsTimator for Sparse Attention

Exploiting sparsity during long-context inference is key to scaling large language models, as attention dominates the cost of autoregressive decoding. Sparse attention reduces this cost by restricting computation to a subset of tokens, but its effectiveness depends on efficient scoring and selection at inference time. We revisit Locality-Sensitive Hashing (LSH) and introduce SOCKET, a SOft Collision Kernel EsTimator that replaces hard bucket matches with probabilistic, similarity-aware aggregation. Traditional LSH yields binary collision signals that limit ranking quality and require substantial memory to perform well. In contrast, soft LSH accumulates graded collision evidence across hash tables, preserving top-k ordering with significantly less memory. This reframes LSH from a candidate generator into a principled scoring kernel for sparse attention. Leveraging this property, SOCKET enables efficient token selection without ad hoc voting and matches or surpasses prior sparse attention methods across multiple long-context benchmarks. With a custom CUDA scoring kernel and a Flash Decode Triton backend, SOCKET achieves up to 1.5$\times$ higher throughput than FlashAttention.

cs.LG

RACE Attention: A Strictly Linear-Time Attention Layer for Training on Outrageously Large Contexts

Softmax Attention has a quadratic time complexity in sequence length, which becomes prohibitive to run at long contexts, even with highly optimized GPU kernels. For example, FlashAttention-2/3 (exact, GPU-optimized implementations of Softmax Attention) cannot complete a single forward-backward pass of a single attention layer once the context exceeds ~4 million tokens on an NVIDIA GH200 (96 GB). We introduce Repeated Arrays-of-Count Estimators (RACE) Attention, a kernel-inspired alternative to Softmax Attention that is strictly linear in sequence length and embedding size. RACE Attention replaces the exponential kernel with a sharpened angular similarity, and approximates attention outputs via Gaussian random projections and soft Locality-Sensitive Hashing (LSH), avoiding construction of the full attention matrix. Across language modeling, masked language modeling, and text/image classification, RACE Attention matches or outperforms strong baselines up to 64K seqeuence length while reducing wall-clock time and memory usage. In addition, we conduct a controlled scaling study on a single attention layer and demonstrate processing of up to 12 million tokens on an NVIDIA GH200 GPU and 75 million tokens on an Intel Xeon Gold 5220R CPU in a single forward-backward pass, which is well beyond the capabilities of current state-of-the-art attention implementations. RACE Attention thus offers a practical and theoretically grounded mechanism for long-context training on today's hardware. We release our code at https://github.com/sahiljoshi515/RACE_Attention.

cs.LG

A note on the unknotting number and the region unknotting number of weaving knots

A weaving knot is an alternating knot whose minimal diagram is a closed braid of a lattice-like pattern. In this paper, the warping degree of a braid diagram is defined, and upper bounds of the unknotting number and the region unknotting number for some families of weaving knots are given by diagrammatical and combinatorial examination of the warping degree of weaving knot diagrams.

math.GT

Non-triviality of welded knots and ribbon torus-knots

In this paper we study welded knots and their invariants. We focus on generating examples of non-trivial knotted ribbon tori as the tube of welded knots that are obtained from classical knot diagrams by welding some of the crossings. Non-triviality is shown by determining the fundamental group of the concerned welded knot. Sample examples under consideration are the standard diagrams of the family of $(2,q)$ torus knots and the twist knots. Standard diagrams of knots from Rolfsen's tables with $6$ crossings are also discussed which are not in the family of torus and twist knots.

math.GT

Determinants of twisted generalized hybrid weaving knots

This article presents a formula for the determinant of the twisted generalized hybrid weaving knot $\hat{Q}_3(m_1,m_2,n,l)$, which is a closed 3-braid. As a corollary, we prove Conjecture 2 of Singh & Chbili [Nuclear Physics B, 980:115800 (2022)].

math.GT

Some evaluations of Jones polynomials for certain families of weaving knots

In this paper, we derive formulae for the determinant of weaving knots $W(3,n)$ and $W(p,2)$. We calculate the dimension of the first homology group with coefficients in $\mathbb{Z}_3$ of the double cyclic cover of the $3$-sphere $S^3$ branched over $W(3,n)$ and $W(p,2)$ respectively. As a consequence, we obtain a lower bound of the unknotting number of $W(3,n)$ for certain values of $n$.

math.GT