betaFeedback

WorksComputer Science

Calibrating Document-Local Boundaries for Contextual Chunk Retrieval

Abstract

Late Chunking encodes an entire document before pooling at chunk boundaries, preserving document context in local retrieval units. Chunk-level post-training improves context-dependent retrieval, but shared context can make semantically similar same-document negatives difficult to distinguish. We study the local decision boundary between a gold chunk and its hardest sibling. Starting from InSeNT, we analyze InSeNT's within-document gradients and show that the entropy of the conditional negative allocation decreases monotonically with the scaling factor at fixed logits. We propose a two-part framework for calibrating document-local chunk boundaries. The first component adapts the discriminative scale from within-document margins, while the second exposes chunk partitions to attention during document encoding. Experiments on ConTEB and NanoBEIR show that the resulting model improves contextual chunk retrieval across the evaluated encoder settings while retaining competitive passage-level retrieval quality; ablations further characterize the distinct roles of adaptive scaling and chunk-aware routing.

Introduction

Long-document retrieval usually returns local evidence that answers a query, rather than the whole document [1]. Its meaning often depends on context: pronouns refer to things mentioned earlier, numbers belong to particular years, and similar expressions may describe different facts [2]. Independent chunk encoding loses these cues, whereas a single document vector cannot localize evidence. Prior work improves contextual retrieval through input enrichment, long-context encoding, and chunk-level post-training [3, 4, 2]. These approaches preserve more document context, but retrieval still requires a model to separate locally similar chunks that share that context.

Because multiple chunks in a document share the same context, retrieval must distinguish the answer-bearing chunk from its same-document siblings; chunk boundaries therefore directly shape the retrieval objective. A useful training signal must preserve global context while distinguishing chunks that share entities, topics, or surface form. Therefore, we treat the gold chunk and its strongest same-document sibling as the basic unit of analysis, and evaluate both contextual and passage-level retrieval. We focus on contrastive post-training with same-document negative chunks. Of 19,974 InSeNT evaluation queries, 6,976 fail to rank gold first. Among these 6,976 queries, the highest-scoring sibling exceeds the gold score in 82.21% of cases, illustrating unresolved local factual confusion. Figure 1 asks for goals in 2019–20: both passages discuss the same player, European competitions, and scoring records, but the hard negative concerns another season.

Figure 1. Season confusion in Football: the same gold–negative pair under InSeNT and DcLBC.

We identify two complementary gaps at this local boundary. First, InSeNT’s fixed inverse temperature jointly controls row-wise total effort and its allocation among siblings, despite heterogeneous query–document margins. AMS instead computes a detached scale from each pair’s gold–hardest-sibling margin and applies it only to the InSeNT within-document loss. Second, distinguishing sibling chunks requires contextual representations that preserve each chunk’s local evidence while incorporating shared document context. Although InSeNT supervises chunks, standard Late Chunking uses partitions only during post-encoder pooling; final-layer attention does not explicitly observe retrieval-unit boundaries.

We propose Document-Chunk Local Boundary Calibration (DcLBC), combining Adaptive Margin Scaling (AMS) and Chunk-Aware Key Routing (CKR). AMS adapts the discriminative scale to focus conditional effort on difficult negatives. CKR injects the chunk partition into post-RoPE Keys, allowing chunk-wise context routing during encoding. Figure 2 summarizes the pipeline from CKR-enabled encoding through chunk pooling and scoring to the AMS loss. Our contributions are:

Overview of DcLBC

Figure 2. Overview of DcLBC. CKR redistributes attention across chunks, while AMS adaptively scales within-document scores.

  • We analyze InSeNT at the query–document row level by separating total score-space effort from its conditional allocation among same-document negatives, and derive how competitor entropy changes with the scale.

  • We introduce DcLBC, combining AMS, which derives a detached instance-level scale from the gold–hardest-sibling margin, with CKR, which injects chunk routing into post-RoPE Keys.

  • We evaluate DcLBC on ConTEB and NanoBEIR with ModernBERT and ModernColBERT backbones, and use component ablations and CKR design tests to measure the contribution of each mechanism.

Related Work

Contextualized Chunk Representations. Standard passage retrieval encodes each chunk independently, which can discard antecedents, definitions, and other evidence located elsewhere in the source document. Several approaches therefore enrich retrieval units with broader context. Contextual Retrieval prepends document-specific explanatory text to each chunk, whereas RAPTOR recursively summarizes and clusters passages into a hierarchical retrieval tree [3, 5]. Landmark Embedding learns landmark tokens that organize a long document into semantically retrievable spans rather than relying only on fixed boundaries [6]. Contextual Document Embeddings condition an item on related documents, extending contextualization beyond a single document [7]. Situated Embedding instead trains passage representations to retain information from their surrounding document context [8]. Late Chunking encodes the full text before pooling token states at chunk boundaries, allowing each pooled chunk to incorporate both left and right context [4]. Context is Gold further introduces In-Sequence Negative Training, in which chunks from the same document serve as competing candidates during contextual embedding post-training [2]. Together, these studies span textual augmentation, hierarchical organization, learned segmentation, contextual encoding, and chunk-level post-training as complementary routes to context-aware retrieval units.

Long-Context and Retrieval-Oriented Encoders. Contextualized retrieval also depends on encoder architectures that can represent long inputs while preserving fine-grained matching signals. Longformer established an efficient bidirectional design based on sparse local and global attention for processing long sequences [9], while ModernBERT revisits bidirectional encoder pretraining with modern architectural and training choices [10]. In dense retrieval, DPR represents queries and passages with dual encoders and scores them by vector similarity, and Contriever demonstrates that retrieval representations can also be learned through unsupervised contrastive pretraining [1, 11]. Late-interaction models retain token-level vectors: ColBERT performs efficient fine-grained matching with a MaxSim operator, and ColBERTv2 improves its quality and storage efficiency through denoised supervision and residual compression [12, 13]. A parallel line adapts decoder-only language models into embedding encoders. Echo Embedding repeats the input to expose token representations to preceding context, LLM2Vec combines bidirectional attention with unsupervised and supervised adaptation, and NV-Embed introduces latent attention pooling together with retrieval-oriented training [14, 15, 16]. These families provide different trade-offs among context length, representation granularity, scoring expressiveness, and retrieval efficiency.

Contrastive Learning, Hard Negatives, and Temperature. Modern embedding models are commonly optimized with contrastive objectives that raise the similarity of matched query–passage pairs relative to negative candidates. SimCSE shows how contrastive learning can produce strong sentence representations using either dropout-based positive pairs or supervised entailment data [17]. For retrieval, negative selection is especially important because randomly sampled passages may become uninformative early in training. ANCE addresses this issue by periodically mining difficult candidates from an approximate nearest-neighbor index, thereby coupling representation learning with the evolving retrieval space [18]. Temperature provides a second control over contrastive optimization: smaller temperatures sharpen the softmax distribution and concentrate gradients on harder negatives [19]. Dual Temperature separates scaling effects associated with different components of contrastive learning to reduce sensitivity to negative-sample quality [20]. MACL further adjusts contrastive training according to model-dependent alignment and uniformity signals rather than using a single fixed optimization regime [21]. This body of research establishes negative construction and logit scaling as central factors governing the strength and distribution of contrastive learning signals.

Analysis and Method

Within-document chunk competition

We first recall InSeNT’s in-sequence loss [2]. Index query–document pairs by ii and chunks within pair ii by jj. The normalized query qi∈Rd\mathbf{q}_i \in\mathbb{R}^{d} has nin_i normalized document chunks cij∈Rdc_{ij} \in\mathbb{R}^{d}, collected as Ci=[ci1,…,cini]⊤C_i = [c_{i1}, \ldots, c_{in_i}]^{\top}, with gold index gig_i. Let α>0\alpha> 0 be the similarity scale and τ>0\tau> 0 the within-document temperature. Holding the cross-document term fixed,

sij=ατqi⊤cij,Lseq(i)=−log⁡exp⁡(sigi)∑j=1niexp⁡(sij).(1)s_{ij} = \frac{\alpha}{\tau}\mathbf{q}_i^{\top}c_{ij}, \qquad\mathcal{L}_{\mathrm{seq}}^{(i)} = -\log\frac{\exp(s_{ig_i})}{\sum_{j=1}^{n_i}\exp(s_{ij})}. \tag*{(1)}

Here sijs_{ij} is the scaled query–chunk logit. The hardest same-document negative and its margin from gold are

hi=arg⁡max⁡j≠gisij,mi=sigi−sihi.(2)h_i = \arg\max_{j \ne g_i} s_{ij}, \qquad m_i = s_{ig_i} - s_{ih_i}. \tag*{(2)}

Smaller mim_i means stronger competition. Let pijp_{ij} be the within-document softmax probability and I[⋅]\mathbb{I}[\cdot] the indicator function:

pij=exp⁡(sij)∑k=1niexp⁡(sik),log⁡pigipihi=mi,∂Lseq(i)∂sij=pij−I[j=gi].(3)p_{ij} = \frac{\exp(s_{ij})}{\sum_{k=1}^{n_i} \exp(s_{ik})}, \qquad \log\frac{p_{ig_i}}{p_{ih_i}} = m_i, \qquad \frac{\partial\mathcal{L}^{(i)}_{\mathrm{seq}}}{\partial s_{ij}} = p_{ij} - \mathbb{I}[j=g_i]. \tag*{(3)}

Thus mim_i is the gold–hard-negative posterior log-odds around which within-document optimization operates.

Document-Chunk Local Boundary Calibration

Local margins vary across query–document pairs. DcLBC addresses this heterogeneity through AMS and CKR.

Adaptive Margin Scaling (AMS)

AMS applies a detached instance-level multiplier κi\kappa_i to within-document scores, with

pij(κ)=exp⁡(κisij)∑k=1niexp⁡(κisik).p_{ij}^{(\kappa)} = \frac{\exp(\kappa_i s_{ij})}{\sum_{k=1}^{n_i} \exp(\kappa_i s_{ik})}.

The local log-odds become

ρi(κi)=log⁡pigi(κ)pihi(κ)=κimi.(4)\rho_i(\kappa_i) = \log\frac{p_{ig_i}^{(\kappa)}}{p_{ih_i}^{(\kappa)}} = \kappa_i m_i. \tag*{(4)}

At training step tt, let μt>0\mu_t > 0 be the detached EMA reference margin and m~i=max⁡(mi,ϵ)\widetilde{m}_i = \max(m_i,\epsilon) the floored margin. Minimizing (κm~i−μt)2(\kappa\widetilde{m}_i-\mu_t)^2 over 1≤κ≤K1 \le\kappa\le K yields

κi=clip⁡(μtm~i,1,K).(5)\kappa_i = \operatorname{clip}\left(\frac{\mu_t}{\widetilde{m}_i},1,K\right). \tag*{(5)}

Here clip⁡(x,l,u)=min⁡(max⁡(x,l),u)\operatorname{clip}(x,l,u)=\min(\max(x,l),u), K≥1K \ge1 caps the scale, and ϵ>0\epsilon> 0 prevents divergence for small or negative margins. Appendix B specifies the EMA update.

Relation to temperature adjustment. For untempered scores uij=aqi⊤ciju_{ij}=a q_i^{\top}c_{ij}, fixed and instance-level temperatures give sij=uij/τs_{ij}=u_{ij}/\tau and uij/τiu_{ij}/\tau_i. AMS is also instance-level temperature adjustment, specifically controlled by local same-document competition:

τiAMS=τκi.(6)\tau_i^{\mathrm{AMS}} = \frac{\tau}{\kappa_i}. \tag*{(6)}

where κi\kappa_i in Eq. (5) adapts the temperature to each query–document pair’s gold–hardest-sibling margin. This adjustment applies only to the sequence loss; cross-document scores retain their original scale. Since ρi=κimi\rho_i=\kappa_i m_i, AMS yields ρi=μt\rho_i=\mu_t whenever mi≥ϵm_i \ge\epsilon and μt/K≤mi≤μt\mu_t/K \le m_i \le\mu_t.

Optimization pressure. Define the total weight and conditional allocation over sibling negatives as

Wi=κi(1−pigi(κ)),rij=pij(κ)1−pigi(κ),j≠gi.(7)W_i = \kappa_i(1-p_{ig_i}^{(\kappa)}), \qquad r_{ij} = \frac{p_{ij}^{(\kappa)}}{1-p_{ig_i}^{(\kappa)}}, \quad j \ne g_i. \tag*{(7)}

Let LDcLBC(i)=−log⁡pigi(κ)\mathcal{L}^{(i)}_{\mathrm{DcLBC}}=-\log p_{ig_i}^{(\kappa)} be the rescaled row loss, and let ∇=∇θ\nabla=\nabla_\theta differentiate with respect to trainable parameters θ\theta while treating κi\kappa_i as constant. Its negative gradient is

−∇LDcLBC(i)=Wi(∇sigi−∑j≠girij∇sij).(8)-\nabla\mathcal{L}^{(i)}_{\mathrm{DcLBC}} = W_i\left(\nabla s_{ig_i}-\sum_{j\ne g_i}r_{ij}\nabla s_{ij}\right). \tag*{(8)}

WiW_i controls total effort and rir_i its allocation over sibling negatives. At fixed logits, replace κi\kappa_i in rir_i by a generic continuous scale κ>0\kappa>0 and denote the resulting allocation by ri(κ)r_i(\kappa). Let H(ri(κ))=−∑j≠girij(κ)log⁡rij(κ)H(r_i(\kappa))=-\sum_{j\ne g_i}r_{ij}(\kappa)\log r_{ij}(\kappa) be its entropy. The sibling-only log-partition has second derivative Var⁡ri(κ)(sij)\operatorname{Var}_{r_i(\kappa)}(s_{ij}), giving

dH(ri(κ))dκ=−κVar⁡ri(κ)(sij)≤0.(9)\frac{\mathrm{d}H(r_i(\kappa))}{\mathrm{d}\kappa} = -\kappa\operatorname{Var}_{r_i(\kappa)}(s_{ij}) \le0. \tag*{(9)}

At fixed logits, increasing κi\kappa_i concentrates negative gradients on higher-scoring competitors, providing a more focused update direction for high-competition documents.

Chunk-Aware Key Routing (CKR)

CKR introduces chunk boundaries into attention by adding a shared offset to the keys of each chunk. Consider one attention head (index omitted), with post-RoPE token queries qs∈Rdhq_s \in\mathbb{R}^{d_h}, keys kt∈Rdhk_t \in\mathbb{R}^{d_h}, and head dimension dhd_h; ss and tt index source and target tokens. From hidden states ht∈Rdmodelh_t \in\mathbb{R}^{d_{\mathrm{model}}} in chunk cc, we compute a routing vector and update its keys:

zc=GELU⁡(WdownLN⁡(Mean⁡t∈cht)),z_c = \operatorname{GELU}\left(W_{\mathrm{down}}\operatorname{LN}\left(\operatorname{Mean}_{t \in c} h_t\right)\right),
kt′=kt+Ukzc,t∈c.(10)k'_t = k_t + U_k z_c,\qquad t \in c. \tag*{(10)}

Here LN denotes layer normalization, Mean averages token states, and GELU is the activation. The learned projections Wdown∈Rr×dmodelW_{\mathrm{down}} \in\mathbb{R}^{r \times d_{\mathrm{model}}} and Uk∈Rdh×rU_k \in\mathbb{R}^{d_h \times r} map through routing dimension rr, so zc∈Rrz_c \in\mathbb{R}^{r}. Adding the offset after RoPE keeps it identical across positions within a chunk. Thus, for source token ss, every token in cc receives the same additive bias to its attention logit ℓst=qsTkt/dh\ell_{st} = q_s^{\mathsf{T}} k_t / \sqrt{d_h}:

ℓst′=ℓst+bsc,bsc=qsTUkzcdh.(11)\ell'_{st} = \ell_{st} + b_{sc},\qquad b_{sc} = \frac{q_s^{\mathsf{T}} U_k z_c}{\sqrt{d_h}}. \tag*{(11)}

Let ast=softmax⁡t(ℓst)a_{st} = \operatorname{softmax}_t(\ell_{st}) be the original attention weight and Asc=∑t∈castA_{sc} = \sum_{t \in c} a_{st} the total attention mass assigned to chunk cc. Applying softmax with the same mask gives

Asc′=ebscAscAs0+∑c′ebsc′Asc′,A'_{sc} = \frac{e^{b_{sc}} A_{sc}}{A_{s0} + \sum_{c'} e^{b_{sc'}} A_{sc'}},
ast′Asc′=astAsc,t∈c, Asc>0.(12)\frac{a'_{st}}{A'_{sc}} = \frac{a_{st}}{A_{sc}},\qquad t \in c,\ A_{sc} > 0. \tag*{(12)}

Here As0A_{s0} is the original mass of special or unassigned tokens, whose keys remain unchanged; all sums respect the attention mask. CKR therefore multiplies each chunk’s mass by ebsce^{b_{sc}} before renormalization, while preserving its internal attention proportions for fixed queries, token states, and routing vectors.

Joint training objective

For a batch of BB query–document pairs, DcLBC retains InSeNT’s cross-document loss Linter\mathcal{L}_{\mathrm{inter}} and rescales the within-document loss:

Lseq(κ)=−1B∑i=1Blog⁡exp⁡(κisigi)∑j=1niexp⁡(κisij).(13)\mathcal{L}^{(\kappa)}_{\mathrm{seq}} = -\frac{1}{B}\sum_{i=1}^{B}\log\frac{\exp(\kappa_i s_{i g_i})}{\sum_{j=1}^{n_i}\exp(\kappa_i s_{i j})}. \tag*{(13)}

With λseq∈[0,1]\lambda_{\mathrm{seq}} \in[0,1] denoting the within-document loss weight, the full objective is

LDcLBC=(1−λseq)Linter+λseqLseq(κ).(14)\mathcal{L}_{\mathrm{DcLBC}} = (1-\lambda_{\mathrm{seq}})\mathcal{L}_{\mathrm{inter}} + \lambda_{\mathrm{seq}}\mathcal{L}^{(\kappa)}_{\mathrm{seq}}. \tag*{(14)}

The detached κi\kappa_i only controls within-document competition. CKR adds no loss: its representations enter both terms, and its parameters are jointly optimized with the encoder. Complete mathematical proofs of all propositions and identities in this section are provided in Appendix A.

Experiments

We evaluate the overall retrieval performance of DcLBC and several baseline methods on ConTEB and NanoBEIR, and examine the contributions of AMS and CKR through component ablations and CKR design analyses.

Experimental setup

Following the training data and two-epoch schedule of Context Is Gold [2], all post-training methods use the MLDR, NarrativeQA, and SQuAD corpora. Our runs use 8×A800 GPUs with BF16 and a learning rate of 2×10−42 \times10^{-4}, and all methods are evaluated at their final checkpoint. Our primary metric is ConTEB eight-task macro normalized discounted cumulative gain at rank 10 (NDCG@10, abbreviated 8DS); NanoBEIR passage retrieval assesses performance without document context. ModernBERT models use normalized 1024-dimensional cosine scores and ModernColBERT uses MaxSim [12, 13].

Main results

Table 1 compares retrieval models on 8DS and NanoBEIR. DcLBC consistently outperforms InSeNT on 8DS across the evaluated encoder and multi-vector backbones. The gains reach 1.40 and 1.91 points on ModernBERT-base and ModernBERT-large, respectively, and peak at 2.45 points on ModernColBERT.

ModelPost-trainingMLDRSQuADNQACOVIDRest.Foot.CitiesEIOPAConTEB AvgNanoBEIR
Retrieval baselines without additional post-training
BM25 [22]–69.4356.1874.6853.7519.9112.2045.610.0041.4743.41
Contriever-MSMARCO (109M) [11]–75.1270.6577.0053.7942.7924.4167.4214.7753.2459.54
Anthropic Contextual–85.4077.1077.7060.7034.8053.9089.40100.0072.40<u>63.20</u>
Encoder models with additional post-training
ModernBERT-base (149M) [10]InfoNCE80.0972.6276.8448.5435.4845.8476.47<u>99.69</u>66.9558.70
InSeNT85.8180.1180.3355.8144.6658.2582.92100.0073.4958.97
DcLBC85.2880.67<u>81.00</u>54.5944.5366.1986.83100.0074.8959.41
ModernBERT-large (395M) [10]InfoNCE81.8972.8978.7051.4644.1463.0785.23100.0072.1759.69
InSeNT88.92<u>80.80</u><u>83.51</u>59.5348.2565.4987.10100.00<u>76.70</u>59.75
DcLBC89.2082.9284.6657.8051.1971.51<u>91.63</u>100.0078.6160.56
ModernColBERT (149M) [23]InfoNCE74.8863.4978.8147.0527.9948.1882.5221.5355.5654.25
InSeNT<u>89.32</u>77.24<u>83.32</u>64.7849.0064.5589.6651.4271.1657.96
DcLBC89.7074.3182.6165.5446.5868.02<u>91.37</u>70.7373.6156.79
LLM-based embedding models (causal attention)
Qwen3-Embedding (596M) [24]–57.1263.9858.6619.5211.7553.0882.1562.9751.1564.91
Harrier (268M) [25]–65.7762.3064.3616.837.7139.3081.7440.2047.2862.64
ML-Embed (596M) [26]–52.2556.2160.1916.1511.1427.9171.5422.0039.6763.18
LLM-based embedding models (bidirectional attention)
pplx-embed-v1 (596M) [27]–84.6874.6181.6953.7626.5762.7882.8886.5669.1956.07
BidirLM (596M) [28]–58.2968.9066.4036.0728.8760.6892.7623.7954.4757.45
Nano-Em1-0.6B-v2 (596M) [29]–49.8741.9860.9026.6722.2220.3774.6333.5741.2849.18

Table 1. ConTEB and NanoBEIR NDCG@10 (%). Parentheses give base-model parameters in millions (M); bold/underline: best/second best. “–” indicates no additional post-training in this study.

For ModernBERT-large, the largest task-level improvements occur on Football by 6.02 points and Cities by 4.53 points, while COVID is the only contextual task that declines. This contrast reflects ConTEB’s construction: Football and Cities suppress explicit mentions of the document subject to require coreference resolution, whereas COVID-QA often provides strong local matches through extractive medical terminology [2]. This concentration suggests that DcLBC is particularly effective when retrieval depends on distinguishing related chunks within a shared document.

For the two ModernBERT encoders, the NanoBEIR results further show that DcLBC does not trade away retrieval quality when document context is absent. The base and large models retain advantages of 0.44 and 0.81 points over InSeNT, reaching 59.41 and 60.56, respectively. Their concurrent gains on context-dependent ConTEB and passage-level NanoBEIR suggest that local boundary calibration is not merely exploiting extra document context.

Ablation and design analysis

We analyze DcLBC components and CKR design, reporting ConTEB eight-task macro NDCG@10 (%). Table 2 first isolates the contributions of AMS and CKR, while Table 3 examines how the routing configuration affects CKR. Because the two studies use separate controlled comparisons, we interpret each configuration relative to the corresponding baseline in its own table.

AMSCKRConTEB AvgΔ\Delta vs. InSeNT
××76.12 ± 0.59–
×✓76.68 ± 0.43+0.56
✓×77.59 ± 0.33+1.47
✓✓78.38 ± 0.23+2.26

Table 2. Component ablation on ModernBERT-large: ConTEB NDCG@10, mean ± standard deviation (SD, %); Δ\Delta in percentage points (pp).

ConfigurationConTEB Avg
Layer coverage
None77.60 ± 0.32
Last 1 (27)77.92 ± 0.42
Last 2 (24, 27)78.05 ± 0.52
Last 3 (21, 24, 27)77.76 ± 0.37
Last 4 (18, 21, 24, 27)78.05 ± 0.39
Chunk alignment
Correct alignment (Last 2)78.05 ± 0.52
Cyclic permutation77.62 ± 0.44

Table 3. CKR design analysis on ModernBERT-large: ConTEB NDCG@10, mean ± standard deviation (SD, %). Alignment tests use Last 2. None disables CKR; other settings share the rank-32 router.

Component ablation

Table 2 shows that AMS raises the mean by 1.47 points to 77.59, while CKR alone reaches 76.68, improving over InSeNT by 0.56 points. When added to AMS, CKR contributes a further 0.79-point gain and brings the combined model to 78.38. The joint improvement of 2.26 points is 0.23 points larger than the sum of the two isolated gains, indicating a modest positive interaction rather than simple redundancy. The combined configuration also has the smallest reported standard deviation (0.23) among the four settings. Thus, both components improve retrieval individually, and their combination performs best without increasing the observed across-run variability.

These results are consistent with the distinct roles suggested by our analysis: AMS controls total optimization effort and, at fixed logits, concentrates negative gradient weight on harder siblings, whereas CKR redistributes attention across chunks during encoding. In the population-wide training diagnostics reported in Appendix § 8.§ 2, AMS raises the query-row mean calibration effort W=N−1∑i=1NWiW = N^{-1}\sum_{i=1}^{N} W_i over the NN recorded training rows from 0.374 to 0.535, a 43.1% increase, further supporting its optimization-side role.

CKR design analysis

Table 3 compares layer coverage and chunk alignment within the AMS-enabled design sweep. Relative to the no-CKR reference at 77.60, routing the last one, two, three, and four selected layers changes the mean to 77.92, 78.05, 77.76, and 78.05, respectively. The non-monotonic pattern shows that increasing the number of routed layers alone does not guarantee a better result. Last 2 and Last 4 attain the same mean, but Last 2 uses fewer routing layers; neither Last 1 nor Last 3 surpasses it. We therefore use Last 2 as the compact default.

Normally, the representation zcz_c aggregated from chunk cc routes the Keys of that same chunk. Cyclically permuting chunk representations within a document breaks this correspondence while retaining the model parameters and other settings. This controlled mismatch reduces the mean from 78.05 to 77.62, a 0.43-point drop. The result indicates that the gain depends not only on adding a routing module, but also on preserving the correspondence between each chunk representation and the chunk whose Keys it modifies.

AMS training dynamics

We track the gold–hardest-sibling margin mim_i and adaptive scale κi\kappa_i during two epochs of DcLBC training with ModernBERT-large. Figure 3 compares four example queries, measured every ten updates in evaluation mode using the current training EMA, with query-weighted training-batch means.

Figure 3. Query margins and adaptive scales during DcLBC training. Solid: example queries; dashed: training means.

Q1 and Q2 retain smaller margins and scales above one, whereas Q3’s scale settles at one and Q4’s fluctuates near this lower bound. This behavior is consistent with Eq. (5): AMS assigns stronger scaling to queries with smaller margins relative to the evolving reference μt\mu_t. Meanwhile, the mean margin increases, suggesting improved average gold–negative separation, and the mean scale stabilizes near 1.44. These trends are compatible because the reference evolves with training: overall separation can improve while relatively difficult queries retain stronger scaling. These trajectories illustrate AMS’s adaptive response; at fixed logits, stronger scaling concentrates negative gradient weight on harder siblings.

Conclusion

We proposed DcLBC for chunk-level retrieval by combining adaptive margin scaling with chunk-aware context routing. On ConTEB, DcLBC consistently outperforms InSeNT across the evaluated encoder and multi-vector backbones, with gains of up to 2.45 NDCG@10 points. Both ModernBERT variants also improve on NanoBEIR, indicating that stronger contextual retrieval need not compromise passage-level performance. Component ablations and CKR design analyses further support the complementary roles of AMS and CKR in calibrating local chunk boundaries.

Supplementary Proofs

This section provides supplementary proofs for § 3.

Row-Level Properties of In-Sequence Negative Training

Proposition A.1 (Posterior Log-Odds and Score-Space Gradient of InSeNT; Eq. (3)). For normalized query qi∈Rdq_i \in\mathbb{R}^{d} with document chunks Ci=[ci1,…,cini]T∈Rni×dC_i = [c_{i1}, \ldots, c_{in_i}]^{\mathsf{T}} \in\mathbb{R}^{n_i \times d}, gold index gig_i, similarity scale a>0a > 0, and temperature τ>0\tau> 0, let sij=(a/τ)qiTcijs_{ij} = (a/\tau)q_i^{\mathsf{T}}c_{ij} and hi∈arg⁡max⁡j≠gisijh_i \in\arg\max_{j \ne g_i} s_{ij}. Define mi=sigi−sihim_i = s_{ig_i} - s_{ih_i} and pij=exp⁡(sij)/∑k=1niexp⁡(sik)p_{ij} = \exp(s_{ij})/\sum_{k=1}^{n_i}\exp(s_{ik}). Then:

log⁡pigipihi=mi,∂Lseq(i)∂sij=pij−I[j=gi].(15)\log\frac{p_{ig_i}}{p_{ih_i}} = m_i,\qquad\frac{\partial\mathcal{L}_{\mathrm{seq}}^{(i)}}{\partial s_{ij}} = p_{ij} - \mathbb{I}[j = g_i]. \tag*{(15)}

Proof. Let Zi=∑k=1niexp⁡(sik)Z_i = \sum_{k=1}^{n_i}\exp(s_{ik}) denote the within-document partition function, so that pij=exp⁡(sij)/Zip_{ij} = \exp(s_{ij})/Z_i. Forming the ratio between the gold probability pigip_{ig_i} and the hardest-sibling probability pihip_{ih_i}, the shared normalizer ZiZ_i cancels:

log⁡pigipihi=log⁡exp⁡(sigi)/Ziexp⁡(sihi)/Zi=sigi−sihi=mi.(16)\log\frac{p_{ig_i}}{p_{ih_i}} = \log\frac{\exp(s_{ig_i})/Z_i}{\exp(s_{ih_i})/Z_i} = s_{ig_i} - s_{ih_i} = m_i. \tag*{(16)}

Next, write the sequence loss in Eq. (1) as Lseq(i)=−log⁡pigi=−sigi+log⁡Zi\mathcal{L}_{\mathrm{seq}}^{(i)} = -\log p_{ig_i} = -s_{ig_i} + \log Z_i. Differentiating with respect to each scaled logit sijs_{ij} yields

∂Lseq(i)∂sij=−I[j=gi]+1Zi∂Zi∂sij=−I[j=gi]+exp⁡(sij)Zi=pij−I[j=gi].(17)\begin{aligned} \frac{\partial\mathcal{L}_{\mathrm{seq}}^{(i)}}{\partial s_{ij}} = -\mathbb{I}[j = g_i] + \frac{1}{Z_i}\frac{\partial Z_i}{\partial s_{ij}} \\ &= -\mathbb{I}[j = g_i] + \frac{\exp(s_{ij})}{Z_i} \\ &= p_{ij} - \mathbb{I}[j = g_i]. \tag*{(17)} \end{aligned}

Because pigi/pihi=exp⁡(mi)p_{ig_i}/p_{ih_i} = \exp(m_i), a smaller margin mim_i directly corresponds to weaker posterior discrimination between the gold chunk and its strongest same-document competitor.

Proposition A.2 (Row Shift Invariance and Zero-Sum Relative Operator). For a single query ii, let Lseq(i)(si)=−sigi+log⁡∑j=1niexp⁡(sij)\mathcal{L}_{\mathrm{seq}}^{(i)}(s_i) = -s_{ig_i} + \log\sum_{j=1}^{n_i}\exp(s_{ij}), and let 1ni\mathbf{1}_{n_i} be the length-nin_i all-ones vector. For any scalar shift b∈Rb \in\mathbb{R}, Lseq(i)(si+b1ni)=Lseq(i)(si)\mathcal{L}_{\mathrm{seq}}^{(i)}(s_i + b\mathbf{1}_{n_i}) = \mathcal{L}_{\mathrm{seq}}^{(i)}(s_i), and the score-space gradient satisfies

∑j=1ni∂Lseq(i)∂sij=0.(18)\sum_{j=1}^{n_i}\frac{\partial\mathcal{L}_{\mathrm{seq}}^{(i)}}{\partial s_{ij}} = 0. \tag*{(18)}

Consequently, the sequence loss acts purely on relative differences among same-document chunks and is invariant to document-wide score translations.

Proof. Replacing sijs_{ij} with sij+bs_{ij} + b multiplies both numerator and denominator inside the logarithm by ebe^b, leaving Lseq(i)\mathcal{L}_{\mathrm{seq}}^{(i)} unchanged. Summing Proposition A.1 over j∈{1,…,ni}j \in\{1,\ldots,n_i\} gives ∑j=1ni(pij−I[j=gi])=∑j=1nipij−1=0\sum_{j=1}^{n_i}(p_{ij} - \mathbb{I}[j = g_i]) = \sum_{j=1}^{n_i}p_{ij} - 1 = 0. □

Adaptive Margin Scaling: Scale Calibration, Effort Decomposition, and Entropy Monotonicity

Proposition A.3 (Constrained Margin-Scale Calibration; Eqs. (4)–(5)). Given reference scale μt>0\mu_t > 0, margin floor ϵ>0\epsilon> 0, and truncated margin m~i=max⁡(mi,ϵ)>0\widetilde{m}_i = \max(m_i,\epsilon) > 0, the box-constrained quadratic calibration problem

κi=arg⁡min⁡κ∈[1,K](κm~i−μt)2(19)\kappa_i = \arg\min_{\kappa\in[1,K]}(\kappa\widetilde{m}_i-\mu_t)^2 \tag*{(19)}

admits the unique closed-form solution κi=clip⁡(μt/m~i,1,K)\kappa_i = \operatorname{clip}(\mu_t/\widetilde{m}_i,1,K). Furthermore, whenever mi≥ϵm_i \ge\epsilon and μt/K≤mi≤μt\mu_t/K \le m_i \le\mu_t, the calibrated posterior odds between the gold chunk and the hardest sibling satisfies ρi(κi)=κimi=μt\rho_i(\kappa_i) = \kappa_i m_i = \mu_t.

Proof. Because m~i>0\widetilde{m}_i > 0, the objective f(κ)=(m~i)2(κ−μt/m~i)2f(\kappa) = (\widetilde{m}_i)^2(\kappa-\mu_t/\widetilde{m}_i)^2 is strictly convex in κ\kappa with unconstrained minimizer κ∗=μt/m~i\kappa^* = \mu_t/\widetilde{m}_i. Projecting κ∗\kappa^* onto the closed interval [1,K][1,K] yields κi=min⁡(max⁡(μt/m~i,1),K)=clip⁡(μt/m~i,1,K)\kappa_i = \min(\max(\mu_t/\widetilde{m}_i,1),K) = \operatorname{clip}(\mu_t/\widetilde{m}_i,1,K). Under scaled logits κisij\kappa_i s_{ij}, the posterior log-odds is

ρi(κi)=log⁡pigi(κ)pihi(κ)=κisigi−κisihi=κimi.(20)\rho_i(\kappa_i) = \log\frac{p_{ig_i}^{(\kappa)}}{p_{ih_i}^{(\kappa)}} = \kappa_i s_{ig_i} - \kappa_i s_{ih_i} = \kappa_i m_i. \tag*{(20)}

If mi≥ϵm_i \ge\epsilon and μt/K≤mi≤μt\mu_t/K \le m_i \le\mu_t, then m~i=mi\widetilde{m}_i=m_i and μt/m~i∈[1,K]\mu_t/\widetilde{m}_i \in[1,K], so κi=μt/mi\kappa_i=\mu_t/m_i and ρi(κi)=μt\rho_i(\kappa_i)=\mu_t. For easy instances (mi>μtm_i>\mu_t), κi=1\kappa_i=1 preserves the baseline scale; for unresolved or inverted margins (mi<μt/Km_i<\mu_t/K), κi=K\kappa_i=K caps the maximum sharpening multiplier. □\square

Proposition A.4 (Optimization Effort and Conditional Negative Allocation; (8)). For a detached row multiplier κi>0\kappa_i>0, let pij(κ)=exp⁡(κisij)/∑k=1niexp⁡(κisik)p_{ij}^{(\kappa)}=\exp(\kappa_i s_{ij})/\sum_{k=1}^{n_i}\exp(\kappa_i s_{ik}), Wi=κi(1−pigi(κ))W_i=\kappa_i(1-p_{igi}^{(\kappa)}), and rij=pij(κ)/(1−pigi(κ))r_{ij}=p_{ij}^{(\kappa)}/(1-p_{igi}^{(\kappa)}) for j≠gij\ne g_i. Define LDcLBC(i)=−log⁡pigi(κ)\mathcal{L}_{\mathrm{DcLBC}}^{(i)}=-\log p_{igi}^{(\kappa)} and ∇=∇θ\nabla=\nabla_\theta with respect to trainable parameters θ\theta, holding κi\kappa_i fixed. Then rir_i is a probability distribution over sibling negatives, and

−∇LDcLBC(i)=Wi(∇sigi−∑j≠girij∇sij).(21)-\nabla\mathcal{L}_{\mathrm{DcLBC}}^{(i)} = W_i\left(\nabla s_{igi}-\sum_{j\ne g_i}r_{ij}\nabla s_{ij}\right). \tag*{(21)}

Proof. Every pij(κ)p_{ij}^{(\kappa)} is positive, and the probabilities sum to one. Hence ∑j≠gipij(κ)=1−pigi(κ)>0\sum_{j\ne g_i}p_{ij}^{(\kappa)}=1-p_{igi}^{(\kappa)}>0, which gives rij>0r_{ij}>0 and ∑j≠girij=1\sum_{j\ne g_i}r_{ij}=1. Because κi\kappa_i is detached in the computation graph, applying the chain rule to LDcLBC(i)=−κisigi+log⁡∑j=1niexp⁡(κisij)\mathcal{L}_{\mathrm{DcLBC}}^{(i)}=-\kappa_i s_{igi}+\log\sum_{j=1}^{n_i}\exp(\kappa_i s_{ij}) yields

−∇LDcLBC(i)=−∑j=1niκi(pij(κ)−I[j=gi])∇sij=κi(1−pigi(κ))∇sigi−∑j≠giκipij(κ)∇sij=Wi∇sigi−Wi∑j≠gipij(κ)1−pigi(κ)∇sij=Wi(∇sigi−∑j≠girij∇sij).(22)\begin{aligned} -\nabla\mathcal{L}_{\mathrm{DcLBC}}^{(i)} = -\sum_{j=1}^{n_i}\kappa_i\left(p_{ij}^{(\kappa)}-\mathbb{I}[j=g_i]\right)\nabla s_{ij} \\ &= \kappa_i\left(1-p_{igi}^{(\kappa)}\right)\nabla s_{igi} -\sum_{j\ne g_i}\kappa_i p_{ij}^{(\kappa)}\nabla s_{ij} \\ &= W_i\nabla s_{igi} -W_i\sum_{j\ne g_i}\frac{p_{ij}^{(\kappa)}}{1-p_{igi}^{(\kappa)}}\nabla s_{ij} \\ &= W_i\left(\nabla s_{igi}-\sum_{j\ne g_i}r_{ij}\nabla s_{ij}\right). \tag*{(22)} \end{aligned}

Thus WiW_i governs the total magnitude of the score-space update, while rir_i governs how repulsive effort is distributed across same-document negative chunks. □\square

Proposition A.5 (Monotonic Decrease of Conditional Competitor Entropy; (9)). At fixed logits {sij}j≠gi\{s_{ij}\}_{j\ne g_i}, let H(ri)=−∑j≠girijlog⁡rijH(r_i)=-\sum_{j\ne g_i}r_{ij}\log r_{ij} be the Shannon entropy of the conditional negative allocation ri(κ)r_i(\kappa). Then

dH(ri)dκ=−κVar⁡ri(sij)≤0,(23)\frac{\mathrm{d}H(r_i)}{\mathrm{d}\kappa} = -\kappa\operatorname{Var}_{r_i}(s_{ij})\le0, \tag*{(23)}

with strict inequality whenever the sibling negative logits {sij}j≠gi\{s_{ij}\}_{j\ne g_i} are not all identical. Moreover, for any pair of sibling negatives j,k≠gij,k\ne g_i with sij>siks_{ij}>s_{ik}, the relative weight ratio rij/rik=exp⁡(κ(sij−sik))r_{ij}/r_{ik}=\exp(\kappa(s_{ij}-s_{ik})) grows strictly with κ\kappa.

Proof. Define the negative-only log-partition function Φi(κ)=log⁡∑j≠giexp⁡(κsij)\Phi_i(\kappa)=\log\sum_{j\ne g_i}\exp(\kappa s_{ij}). Because the gold term cancels when conditioning on j≠gij\ne g_i, the conditional distribution is an exponential family in canonical parameter κ\kappa:

rij(κ)=exp⁡(κsij)∑k≠giexp⁡(κsik)=exp⁡(κsij−Φi(κ)).(24)r_{ij}(\kappa) = \frac{\exp(\kappa s_{ij})}{\sum_{k\ne g_i}\exp(\kappa s_{ik})} = \exp\left(\kappa s_{ij}-\Phi_i(\kappa)\right). \tag*{(24)}

Standard cumulant-generating properties of exponential families give the first and second derivatives of Φi(κ)\Phi_i(\kappa):

Φi′(κ)=∑j≠girijsij=Eri[sij],\Phi_i'(\kappa) = \sum_{j\ne g_i}r_{ij}s_{ij} = \mathbb{E}_{r_i}[s_{ij}],
Φi′′(κ)=∑j≠girij(sij−Eri[sij])2=Var⁡ri(sij).(25)\Phi_i''(\kappa) = \sum_{j\ne g_i}r_{ij}\left(s_{ij}-\mathbb{E}_{r_i}[s_{ij}]\right)^2 = \operatorname{Var}_{r_i}(s_{ij}). \tag*{(25)}

Substituting log⁡rij=κsij−Φi(κ)\log r_{ij}=\kappa s_{ij}-\Phi_i(\kappa) into the Shannon entropy definition yields the Legendre relation

H(ri)=−∑j≠girij(κsij−Φi(κ))=Φi(κ)−κΦi′(κ).(26)H(r_i) = -\sum_{j\ne g_i}r_{ij}\left(\kappa s_{ij}-\Phi_i(\kappa)\right) = \Phi_i(\kappa)-\kappa\Phi_i'(\kappa). \tag*{(26)}

Differentiating with respect to κ\kappa via the product rule cancels the Φi′(κ)\Phi_i'(\kappa) terms:

dH(ri)dκ=Φi′(κ)−Φi′(κ)−κΦi′′(κ)=−κVar⁡ri(sij)≤0.(27)\frac{\mathrm{d}H(r_i)}{\mathrm{d}\kappa} = \Phi_i'(\kappa)-\Phi_i'(\kappa)-\kappa\Phi_i''(\kappa) = -\kappa\operatorname{Var}_{r_i}(s_{ij})\le0. \tag*{(27)}

For κ>0\kappa>0, Var⁡ri(sij)>0\operatorname{Var}_{r_i}(s_{ij})>0 whenever the non-gold scores are not identical, establishing strict monotonicity. □\square

Chunk-Aware Key Routing: Exact Attention Factorization

Proposition A.6 (Post-RoPE Chunk-Mass Factorization and Within-Chunk Ratio Invariance; Eqs. (11)–(12)). Consider a single attention head with post-RoPE query qs∈Rdhq_s\in\mathbb{R}^{d_h} at source token ss and post-RoPE keys kt∈Rdhk_t\in\mathbb{R}^{d_h} at target tokens tt. Suppose CKR shifts keys inside each routed chunk cc by a chunk-shared offset kt′=kt+Ukzck'_t=k_t+U_k z_c (t∈c)(t\in c), while leaving special or unassigned tokens (t∈c0)(t\in c_0) unrouted (kt′=kt)(k'_t=k_t). Let ℓst=qsTkt/dh\ell_{st}=q_s^\mathsf{T}k_t/\sqrt{d_h}, ast=softmax⁡t(ℓst)a_{st}=\operatorname{softmax}_t(\ell_{st}), and Asc=∑t∈castA_{sc}=\sum_{t\in c}a_{st}. Then under CKR:

  1. The routed chunk attention mass satisfies

Asc′=ebscAscAs0+∑c′ebsc′Asc′,bsc=qsTUkzcdh.(28)A'_{sc} = \frac{e^{b_{sc}}A_{sc}}{A_{s0}+\sum_{c'}e^{b_{sc'}}A_{sc'}}, \qquad b_{sc}=\frac{q_s^\mathsf{T}U_kz_c}{\sqrt{d_h}}. \tag*{(28)}
  1. For any chunk cc with Asc>0A_{sc}>0 and any token t∈ct\in c, the conditional within-chunk token weight is invariant:

ast′Asc′=astAsc,ast′asu′=astasu,t,u∈c.(29)\frac{a'_{st}}{A'_{sc}}=\frac{a_{st}}{A_{sc}}, \qquad \frac{a'_{st}}{a'_{su}}=\frac{a_{st}}{a_{su}}, \qquad t,u\in c. \tag*{(29)}

Proof. For any target token t∈ct\in c, linearity of the inner product after RoPE gives

ℓst′=qsT(kt+Ukzc)dh=qsTktdh+qsTUkzcdh=ℓst+bsc.(30)\ell'_{st} = \frac{q_s^\mathsf{T}(k_t+U_kz_c)}{\sqrt{d_h}} = \frac{q_s^\mathsf{T}k_t}{\sqrt{d_h}} + \frac{q_s^\mathsf{T}U_kz_c}{\sqrt{d_h}} = \ell_{st}+b_{sc}. \tag*{(30)}

Let Zs=∑νexp⁡(ℓsν)Z_s=\sum_\nu\exp(\ell_{s\nu}) be the original row normalizer, where ν\nu ranges over valid target tokens. Then Zsc=∑t∈cexp⁡(ℓst)=Z_{sc}=\sum_{t\in c}\exp(\ell_{st})=

ZsAscZ_s A_{sc} and Zs0=∑t∈c0exp⁡(ℓst)=ZsAs0Z_{s0} = \sum_{t \in c_0} \exp(\ell_{st}) = Z_s A_{s0}. Under the routed logits ℓst′\ell'_{st}, the unnormalized chunk sum factors as

Zsc′=∑t∈cexp⁡(ℓst+bsc)=ebsc∑t∈cexp⁡(ℓst)=ebscZsc=ZsebscAsc,(31)\begin{aligned} Z'_{sc} &= \sum_{t \in c} \exp(\ell_{st} + b_{sc}) \\ &= e^{b_{sc}} \sum_{t \in c} \exp(\ell_{st}) \\ &= e^{b_{sc}} Z_{sc} = Z_s e^{b_{sc}} A_{sc}, \tag*{(31)} \end{aligned}

while Zs0′=Zs0=ZsAs0Z'_{s0} = Z_{s0} = Z_s A_{s0}. Dividing Zsc′Z'_{sc} by the new total normalizer Zs′=Zs0′+∑c′Zsc′′Z'_s = Z'_{s0} + \sum_{c'} Z'_{sc'} and canceling the common positive factor ZsZ_s yields the chunk-mass formula in Claim 1. Finally, for any t∈ct \in c with Asc>0A_{sc} > 0,

ast′Asc′=exp⁡(ℓst′)/Zs′Zsc′/Zs′=ebscexp⁡(ℓst)ebscZsc=exp⁡(ℓst)/ZsZsc/Zs=astAsc,(32)\frac{a'_{st}}{A'_{sc}} = \frac{\exp(\ell'_{st})/Z'_s}{Z'_{sc}/Z'_s} = \frac{e^{b_{sc}}\exp(\ell_{st})}{e^{b_{sc}}Z_{sc}} = \frac{\exp(\ell_{st})/Z_s}{Z_{sc}/Z_s} = \frac{a_{st}}{A_{sc}}, \tag*{(32)}

which establishes Claim 2. Note that applying the translation after rotary position embedding is essential: if UkzcU_k z_c were added before position-dependent rotation RtR_t, the effective bias qsTRt(Ukzc)/dhq_s^\mathsf{T} R_t(U_k z_c)/\sqrt{d_h} would vary with token position tt, breaking within-chunk ratio invariance. □

Boundary-Aligned Geometric Work

Proposition A.7 (Boundary-Aligned Work Identity and Magnitude Bound). Let Ci∈Rni×dC_i \in\mathbb{R}^{n_i \times d} contain the normalized chunk embeddings of document ii, let qi∈Rdq_i \in\mathbb{R}^d satisfy ∥qi∥2=1\lVert q_i \rVert_2 = 1, and let ej∈Rnie_j \in\mathbb{R}^{n_i} denote the jjth standard basis vector. Define vi=egi−ehiv_i = e_{g_i} - e_{h_i}. For updated embeddings Ci′C'_i and displacement ΔCi=Ci′−Ci\Delta C_i = C'_i - C_i at fixed (qi,gi,hi)(q_i, g_i, h_i), the cosine-margin change Δmicos⁡=(cigi′−cihi′)Tqi−(cigi−cihi)Tqi\Delta m_i^{\cos} = (c'_{ig_i} - c'_{ih_i})^\mathsf{T}q_i - (c_{ig_i} - c_{ih_i})^\mathsf{T}q_i satisfies

Δmicos⁡=viTΔCiqi=⟨ΔCi,viqiT⟩F,(33)\begin{aligned} \Delta m_i^{\cos} &= v_i^\mathsf{T}\Delta C_i q_i \\ &= \langle\Delta C_i, v_i q_i^\mathsf{T} \rangle_F, \tag*{(33)} \end{aligned}
∣Δmicos⁡∣≤2∥ΔCi∥F.\left|\Delta m_i^{\cos}\right| \le\sqrt{2}\lVert\Delta C_i\rVert_F.

Proof. Writing the cosine margin as micos⁡=viTCiqim_i^{\cos} = v_i^\mathsf{T} C_i q_i, linearity yields Δmicos⁡=viTΔCiqi=tr⁡((viqiT)ΔCi)=⟨ΔCi,viqiT⟩F\Delta m_i^{\cos} = v_i^\mathsf{T}\Delta C_i q_i = \operatorname{tr}((v_iq_i^\mathsf{T})\Delta C_i) = \langle\Delta C_i, v_iq_i^\mathsf{T}\rangle_F. Applying the Frobenius Cauchy–Schwarz inequality gives

∣Δmicos⁡∣≤∥ΔCi∥F∥viqiT∥F=∥ΔCi∥F∥vi∥2∥qi∥2=2∥ΔCi∥F,(34)\begin{aligned} \left|\Delta m_i^{\cos}\right| &\le\lVert\Delta C_i\rVert_F \lVert v_iq_i^\mathsf{T}\rVert_F \\ &= \lVert\Delta C_i\rVert_F \lVert v_i\rVert_2 \lVert q_i\rVert_2 \\ &= \sqrt{2}\lVert\Delta C_i\rVert_F, \tag*{(34)} \end{aligned}

since ∥egi−ehi∥2=2\lVert e_{g_i} - e_{h_i}\rVert_2 = \sqrt{2} for gi≠hig_i \ne h_i and ∥qi∥2=1\lVert q_i\rVert_2 = 1. Moreover, because viT1ni=0v_i^\mathsf{T}\mathbf{1}_{n_i} = 0, any common shift δ∈Rd\delta\in\mathbb{R}^d applied as ΔCi=1niδT\Delta C_i = \mathbf{1}_{n_i}\delta^\mathsf{T} contributes zero to Δmicos⁡\Delta m_i^{\cos}. Thus retrieval improvement depends on signed alignment with the rank-one boundary operator viqiTv_iq_i^\mathsf{T} rather than raw representation movement or global cluster expansion. □

Implementation Details

All ModernBERT-large variants use the same pre-tokenized training documents, data order, and evaluation pipeline. Documents are capped at 8,192 tokens and encoded once before Late Chunking mean pooling.

ComparisonQ1Q2Q3Q4
AMS − InSeNT+4.14+2.01−1.00−0.09
CKR increment+1.32+0.56+0.33+0.32
DcLBC − InSeNT+5.46+2.57−0.67+0.23

Table C.1. NDCG@10 gains in percentage points (pp) by baseline InSeNT margin quartile. Q1Q_1 denotes the highest-competition queries.

Post-training runs for two epochs with a global batch of 64 in BF16. We use AdamW with a peak learning rate of 2×10−42 \times10^{-4}, cosine decay, a short warmup, and no weight decay. The inter-document and within-document objectives are combined with λseq=0.1\lambda_{\mathrm{seq}} = 0.1; the similarity scale is a=20a = 20, and the within-document temperature is 1.0 for InSeNT and 0.8 for AMS-based variants.

AMS uses K=2K = 2, margin floor ϵ=10−4\epsilon= 10^{-4}, and EMA decay γ=0.99\gamma= 0.99. Let Bt\mathcal{B}_t be the query rows local to the device at the ttth within-document loss call and

mˉt=1∣Bt∣∑i∈Btmax⁡(mi,ϵ).(35)\bar{m}_t = \frac{1}{|\mathcal{B}_t|} \sum_{i \in\mathcal{B}_t} \max(m_i,\epsilon). \tag*{(35)}

The first call sets μ0=mˉ0\mu_0 = \bar{m}_0; subsequent calls update

μt=γμt−1+(1−γ)mˉt.(36)\mu_t = \gamma\mu_{t-1} + (1-\gamma)\bar{m}_t. \tag*{(36)}

This EMA is not synchronized across devices, and both μt\mu_t and κt\kappa_t are detached from gradient computation. CKR is applied to the final two global-attention layers through one shared rank-32 bottleneck. Its bias-free Key up-projection is zero-initialized, so post-training begins from the pretrained attention distribution.

The resulting chunk vectors are L2-normalized and retrieved with a single cosine score. AMS changes only the training loss and therefore introduces no inference-time operation. CKR adds only the shared bottleneck while leaving the embedding dimension and retrieval procedure unchanged.

Boundary and Optimization Diagnostics

Competition-Stratified Retrieval Analysis

We partition queries within each ConTEB dataset into quartiles ordered by the baseline InSeNT gold–hardest-sibling margin. The first quartile contains the most difficult local competitions. Table C.1 gives the compact numerical summary, while Figure C.1 shows both the concentration of gains in this regime and the query-level association between boundary-margin changes and retrieval changes.

AMS contributes most strongly in Q1Q_1 and Q2Q_2, where the baseline gold–sibling margin is smallest, rather than uniformly shifting all retrieval scores. CKR adds a positive increment in every quartile, including those for which the AMS-only change is small or negative. Their profiles are therefore complementary: AMS supplies the largest difficult-regime correction, whereas CKR provides a smaller but broader refinement. Figure C.1 also shows dataset-level uncertainty and the centered association between changes in boundary margin and retrieval quality.

Figure C.1. Boundary diagnostics. (a) AMS and full DcLBC gains by baseline margin quartile; connectors show the CKR increment and error bars show the dataset-level standard error of the mean (SEM). (b) Within-dataset centered margin and NDCG@10 changes, aggregated into equal-frequency bins.

Optimization Dynamics

Figure C.2 shows that, relative to fixed-scale InSeNT, AMS keeps the adaptive scale above one, increases calibration effort, and reduces conditional sibling-allocation entropy. This is consistent with Proposition A.5: difficult rows receive stronger, more concentrated updates. Routed-layer reconstructions further indicate that CKR redistributes attention across chunks and sharpens final-layer target selection.

Figure C.2. Population training dynamics: adaptive scale, calibration effort, and conditional negative-allocation entropy.

Robustness and Baseline Comparisons

Temperature Baseline Comparisons

Table D.1 compares AMS and DcLBC with fixed and adaptive temperature baselines under the same protocol [20, 21]. Controlled-3 is not a separate dataset: it is the macro average over Football, Cities, and EIOPA, the three ConTEB tasks that most directly require document context to resolve a chunk. The comparison shows that global temperature schedules do not match AMS’s query-specific document-local calibration.

Additional Encoder Evidence

Controlled-3 Context-Necessity Subset and Sub-1B LLM Encoders

Controlled-3 is not a standalone dataset but the unweighted macro average of NDCG@10 on Football, Cities, and EIOPA [2]. Football and Cities require document-level entity resolution, whereas EIOPA requires disambiguation among structurally similar regulatory sections. This subset focuses on retrieval that requires document context. DcLBC

MethodConTEB AvgControlled-3
InSeNT (τ=1.0\tau= 1.0)76.7084.20
Fixed τ=0.8\tau= 0.877.1585.08
Dual Temperature [20]62.4464.28
MACL (temp.-only) [21]76.1582.71
MACL (full) [21]63.9665.84
AMS (Ours)77.9687.05
DcLBC (AMS + CKR, Ours)78.6187.71

Table D.1. Temperature baselines on ModernBERT-large (NDCG@10, %). Controlled-3 is the macro average over the Football, Cities, and EIOPA datasets in ConTEB.

ModelConTEBControlled-3
Causal encoders
Qwen3-Embedding [24]51.37 / 51.1530.85 / 66.07
Harrier OSS [25]51.54 / 47.2835.66 / 53.75
ML-Embed [26]45.91 / 39.6725.10 / 40.48
Bidirectional encoders
Giga Embeddings [30]55.75 / 63.5835.22 / 68.43
pplx-embed-v1 [27]46.79 / 69.1926.08 / 77.41
BidirLM [28]43.02 / 54.4723.30 / 59.08
Nano-EM-v1-2 [29]39.17 / 41.2821.81 / 42.86

Table E.1. Aggregate zero-shot comparison of Direct and Late Chunking (LC) modes (NDCG@10, %). Each score pair is reported as Direct / LC.

outperforms InSeNT on this subset across all three evaluated backbones.

Table E.1 compares independent chunk encoding (Direct) with Late Chunking (LC) for zero-shot sub-1B LLM encoders. LC is inconsistent for causal last-token encoders but improves all evaluated bidirectional mean-pooling encoders on both aggregate columns, consistent with the directionality of context propagation.

References

  1. [1]Vladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen-tau Yih, “Dense passage retrieval for open-domain question answering,” in Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP). 2020, pp. 6769–6781, Association for Computational Linguistics.arxiv.org/abs/2004.04906
  2. [2]Max Conti, Manuel Faysse, Gautier Viaud, Antoine Bosselut, Céline Hudelot, and Pierre Colombo, “Context is gold to find the gold passage: Evaluating and training contextual document embeddings,” in Proc. EMNLP. 2025, pp. 22594–22608, Association for Computational Linguistics.
  3. [3]Anthropic, “Contextual retrieval in AI systems,” Anthropic Engineering, September 2024.
  4. [4]Michael Günther, Isabelle Mohr, Daniel James Williams, Bo Wang, and Han Xiao, “Late chunking: Contextual chunk embeddings using long-context embedding models,” arXiv preprint arXiv:2409.04701, 2024.
  5. [5]Parth Sarthi, Salman Abdullah, Aditi Tuli, Shubh Khanna, Anna Goldie, and Christopher D. Manning, “RETROR: Recursive abstractive processing for tree-organized retrieval,” in Proc. ICLR. 2024, OpenReview.net.arxiv.org/abs/2401.18059
  6. [6]Kun Luo, Zheng Liu, Shitao Xiao, Tong Zhou, Yubo Chen, Jun Zhao, and Kang Liu, “Landmark embedding: A chunking-free embedding method for retrieval augmented long-context large language models,” in Proc. ACL (Long Papers). 2024, pp. 3268–3281, Association for Computational Linguistics.
  7. [7]John Xavier Morris and Alexander M. Rush, “Contextual document embeddings,” in Proc. ICLR. 2025, OpenReview.net.arxiv.org/abs/2410.02525
  8. [8]Junjie Wu, Jiangnan Li, Yuqing Li, Lemao Liu, Liyang Xu, Jiwei Li, Dit-Yan Yeung, Jie Zhou, and Mo Yu, “Situated embedding models for context-aware dense retrieval,” in Proc. ACL (Short Papers). 2026, pp. 37–49, Association for Computational Linguistics.
  9. [9]Iz Beltagy, Matthew E. Peters, and Arman Cohan, “Longformer: The long-document transformer,” arXiv preprint arXiv:2004.05150, 2020.arxiv.org/abs/2004.05150
  10. [10]Benjamin Warner, Antoine Chaffin, Benjamin Clavié, Orion Weller, Oskar Hallström, Said Taghadouini, Alexis Gallagher, Raja Biswas, Faisal Ladhak, Tom Aarsen, Nathan Cooper, Griffin Adams, Jeremy Howard, and Iacopo Poli, “Smarter, better, faster, longer: A modern bidirectional encoder for fast, memory efficient, and long context finetuning and inference,” arXiv preprint arXiv:2412.13663, 2024.arxiv.org/abs/2412.13663
  11. [11]Gautier Izacard, Mathilde Caron, Lucas Hosseini, Sebastian Riedel, Piotr Bojanowski, Armand Joulin, and Edouard Grave, “Unsupervised dense information retrieval with contrastive learning,” CoRR, vol. abs/2112.09118, 2021.arxiv.org/abs/2112.09118
  12. [12]Omar Khattab and Matei Zaharia, “ColBERT: Efficient and effective passage search via contextualized late interaction over BERT,” in Proc. ACM SIGIR, 2020, pp. 39–48.arxiv.org/abs/2004.12832
  13. [13]Keshav Santhanam, Omar Khattab, Jon Saad-Falcon, Christopher Potts, and Matei Zaharia, “ColBERTv2: Effective and efficient retrieval via lightweight late interaction,” in Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies. 2022, pp. 3715–3734, Association for Computational Linguistics.
  14. [14]Jacob Mitchell Springer, Suhas Kotha, Daniel Fried, Graham Neubig, and Aditi Raghunathan, “Repetition improves language model embeddings,” in Proc. ICLR. 2025, OpenReview.net.arxiv.org/abs/2402.15449
  15. [15]Parishad BehnamGhader, Vaibhav Adlakha, Marius Mosbach, Dzmitry Bahdanau, Nicolas Chapados, and Siva Reddy, “LLM2Vec: Large language models are secretly powerful text encoders,” CoRR, vol. abs/2404.05961, 2024.arxiv.org/abs/2404.05961
  16. [16]Chankyu Lee, Rajarshi Roy, Mengyao Xu, Jonathan Raimon, Mohammad Shoeybi, Bryan Catanzaro, and Wei Ping, “NV-Embed: Improved techniques for training LLMs as generalist embedding models,” in Proc. ICLR. 2025, OpenReview.net.arxiv.org/abs/2405.17428
  17. [17]Tianyu Gao, Xingcheng Yao, and Danqi Chen, “SimCSE: Simple contrastive learning of sentence embeddings,” in Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing. 2021, pp. 6894–6910, Association for Computational Linguistics.arxiv.org/abs/2104.08821
  18. [18]Lee Xiong, Chenyan Xiong, Ye Li, Kwok-Fung Tang, Jialin Liu, Paul N. Bennett, Junaid Ahmed, and Arnold Overwijk, “Approximate nearest neighbor negative contrastive learning for dense text retrieval,” in International Conference on Learning Representations, 2021.
  19. [19]Feng Wang and Huaping Liu, “Understanding the behaviour of contrastive loss,” in Proc. IEEE/CVF CVPR, 2021, pp. 2495–2504.arxiv.org/abs/2012.09740
  20. [20]Chaoning Zhang, Kang Zhang, Trung X. Pham, Axi Niu, Zhinan Qiao, Chang D. Yoo, and In So Kweon, “Dual temperature helps contrastive learning without many negative samples: Towards understanding and simplifying MoCo,” in Proc. IEEE/CVF CVPR, 2022, pp. 14441–14450.arxiv.org/abs/2203.17248
  21. [21]Zizheng Huang, Haoxing Chen, Ziqi Wen, Chao Zhang, Huaxiong Li, Bo Wang, and Chunlin Chen, “Model-aware contrastive learning: Towards escaping the dilemmas,” in Proc. ICML. 2023, vol. 202 of Proceedings of Machine Learning Research, pp. 13774–13790, PMLR.arxiv.org/abs/2207.07874
  22. [22]Stephen E. Robertson, Steve Walker, Susan Jones, Micheline Hancock-Beaulieu, and Mike Gatford, “Okapi at TREC-3,” in Proc. TREC-3, 1994, pp. 109–126.
  23. [23]Antoine Chaffin, “GTE-ModernColBERT-v1 model card,” Hugging Face Face model repository, 2025.
  24. [24]Yanzhao Zhang, Mingxin Li, Dingkun Long, Xin Zhang, Huan Lin, Baosong Yang, Pengjun Xie, An Yang, Dayiheng Liu, Junyang Lin, Fei Huang, and Jingren Zhou, “Qwen3 Embedding: Advancing text embedding and reranking through foundation models,” arXiv preprint arXiv:2506.05176, 2025.arxiv.org/abs/2506.05176
  25. [25]Microsoft, “Harrier OSS v1 270M model card,” Hugging Face model repository, 2026.
  26. [26]CodeFuse AI, “ML-Embed-0.6B model card,” Hugging Face model repository, 2026.
  27. [27]Sedigheh Eslami, Maksim Gaiduk, Markus Krimmel, Louis Milliken, Bo Wang, and Denis Bykov, “Diffusion-pretrained dense and contextual embeddings,” arXiv preprint arXiv:2602.11151, 2026.arxiv.org/abs/2602.11151
  28. [28]Nicolas Boizard, Théo Deschamps-Berger, Hippolyte Gisserot-Boukhlef, Céline Hudelot, and Pierre Colombo, “BidirLM: From text to multimodal bidirectional encoders by adapting and composing causal LLMs,” arXiv preprint arXiv:2604.02045, 2026.arxiv.org/abs/2604.02045
  29. [29]KiteFish AI, “Nano-EmI-0.6B-v2 model card,” Hugging Face model repository, 2026.
  30. [30]AI Sage, “Giga Embeddings Instruct 480M model card,” Hugging Face model repository, 2026.

Paper details

vlnc:W_rv994ham
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 13

downloads · 1

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents