---
title: Local Dense Relational Logit Distillation
url: https://www.emergentmind.com/topics/local-dense-relational-logit-distillation-ldrld
type: topic
---

# Local Dense Relational Logit Distillation

Searching arXiv for the primary paper and closely related distillation work to ground the article in cited literature.
to=arxiv_search.search  天天中json code  syntax not sure.
to=arxiv_search.search  彩神争霸输钱json code
{"query":"arXiv:2507.15911"}【อ่านข้อความเต็มjson code
to=arxiv_search.search ￣奇米影视json code
{"query":"2507.15911"} күңелjson code
Searching for related arXiv papers on local dense relational/logit distillation and relational distillation variants.
Local Dense Relational Logit Distillation (LDRLD) is a logit-based knowledge distillation method introduced in 2025 to transfer fine-grained inter-class knowledge from a teacher to a student by recursively selecting a ranked local subset of logits, recombining that subset into dense pairwise relations, weighting those relations according to rank structure, and distilling the remaining non-target logits to preserve knowledge completeness. In the formulation of “Local Dense Logit Relations for Enhanced Knowledge Distillation” [2507.15911], LDRLD addresses a limitation of vanilla logit distillation: global softened-softmax alignment over all $C$ classes tends to emphasize high-probability classes, suppress differences among low-probability classes, and weaken fine-grained inter-class discriminability, particularly for semantically similar classes.

## 1. Conceptual basis and motivation

The starting point for LDRLD is standard logit-based KD. Let teacher and student logits be $Z^t \in \mathbb{R}^{1\times C}$ and $Z^s \in \mathbb{R}^{1\times C}$, with softened probabilities $p^t$ and $p^s$ obtained by softmax with temperature. Vanilla KD minimizes $\mathrm{KL}(P^t\Vert P^s)$ globally over all classes. The paper argues that this global coupling induces information redundancy and weakens discriminability among confusing classes, because unrelated classes participate in the same normalization and dilute local contrasts [2507.15911].

LDRLD replaces that globally coupled view with a local dense relational view. Rather than treating the logit vector only as a distribution over all classes, it identifies a small ranked subset of classes from the student’s current hypotheses, constructs all pairwise relations inside that subset, and distills those relations with adaptive importance weights. The method then distills the remaining non-target logits outside the selected subset so that the student is not trained only on a truncated local view.

A central intuition is given by pairwise normalization. When the relation between two categories is computed through a two-class softmax, the inter-class contrast is sharper than under global softmax; the paper notes that $|p_1^t-p_2^t|$ under pairwise normalization is larger than under global normalization. This local contrast is used as the basic carrier of fine-grained knowledge in LDRLD [2507.15911].

## 2. Recursive local subset construction and dense pair formation

For a given sample, LDRLD sorts the student logits $Z^s$ in descending order and denotes by $\pi(d)$ the index of the $d$-th largest logit. The recursion depth $d\le C$ determines the size of the local subset. At iteration $d$, the current top-1 unmasked student logit is extracted, with
$$
i_{\max}=\arg\max_i Z_i^s,
$$
and a mask $M\in\mathbb{R}^C$ is applied so that
$$
M_{\pi(d)}=-\infty \text{ if } \pi(d)=i_{\max}, \text{ and } 1 \text{ otherwise.}
$$
The teacher and student logits are then updated by Hadamard masking,
$$
Z^t \leftarrow M\odot Z^t,\qquad Z^s \leftarrow M\odot Z^s,
$$
which prevents reselection of the same logit. After $d$ iterations, the selected teacher and student logits form
$$
H^t=[Z_1^t,\ldots,Z_d^t]\subset Z^t,\qquad H^s=[Z_1^s,\ldots,Z_d^s]\subset Z^s.
$$

The selected subset is then recombined into all pairwise class relations. For every pair $(i,j)$ with $1\le i<j\le d$, LDRLD concatenates the two logits into a two-dimensional relation using $\phi(Z_i,Z_j)$. The paper writes this recursively as
$$
C_{d-1}^t=\left\{C_{d-2}^t \cup \bigcup_{i=1}^{d-1}\{\phi(Z_i^t,Z_d^t)\}\right\}\in\mathbb{R}^{(d(d-1)/2)\times 2},
$$
with the analogous definition for $C_{d-1}^s$.

Each pair is normalized independently by a two-class softmax with temperature $\tau$. For a pair $(i,j)$,
$$
S_{ij}^t=\exp(Z_i^t/\tau)+\exp(Z_j^t/\tau),\qquad
S_{ij}^s=\exp(Z_i^s/\tau)+\exp(Z_j^s/\tau),
$$
and
$$
p_i^t=\frac{\exp(Z_i^t/\tau)}{S_{ij}^t},\quad
p_j^t=\frac{\exp(Z_j^t/\tau)}{S_{ij}^t},\quad
p_i^s=\frac{\exp(Z_i^s/\tau)}{S_{ij}^s},\quad
p_j^s=\frac{\exp(Z_j^s/\tau)}{S_{ij}^s}.
$$
The resulting unweighted relational loss over all pairs among the $d$ selected logits is
$$
L=\sum_{i=1}^{d-1}\sum_{j=i+1}^{d}\left[p_i^t\log\frac{p_i^t}{p_i^s}+p_j^t\log\frac{p_j^t}{p_j^s}\right].
$$

This construction is dense in the sense that the selected local subset generates $O(d^2)$ pairwise relations, but local in the sense that it is restricted to the student’s current top-$d$ hypotheses rather than all $O(C^2)$ class pairs [2507.15911].

## 3. Objective function: ADW, LLKI, and remaining non-target knowledge

LDRLD supplements pairwise relational transfer with two additional components. The first is Local Logit Knowledge Integrity (LLKI), which preserves the sequential arrangement of the selected logits. LLKI is defined as
$$
L_{LLKI}=KL(H^t,H^s)=\sum_{i=1}^{d}p_i^t\log\frac{p_i^t}{p_i^s},
$$
where $p_i^t=\sigma(Z_i^t/\tau)$ and $p_i^s=\sigma(Z_i^s/\tau)$, and $\sigma$ is softmax over the $d$ selected logits.

The second is the Adaptive Decay Weight (ADW), which assigns different weights to different class pairs. ADW combines Inverse Rank Weighting (IRW) and Exponential Rank Decay (ERD). If $R$ and $R'$ are the rank positions of two classes in the local subset, then
$$
\Gamma_{IRW}(R',R)=Inv(|R-R'|+\epsilon),\qquad \epsilon=1.50,\qquad Inv(x)=1/x,
$$
and
$$
\Phi_{ERD}(R',R)=\delta\times \exp(-\lambda(R+R')),
\qquad \delta=2.0,\qquad \lambda=0.05.
$$
The combined weight is
$$
\Omega_{ADW}(R',R)=\Gamma_{IRW}(R',R)\times \Phi_{ERD}(R',R).
$$
IRW emphasizes pairs whose ranks are closer, while ERD reduces weights for pairs lower in the ranked list. The weighted local relational loss is therefore
$$
L^{w}=\sum_{i=1}^{d-1}\sum_{j=i+1}^{d}\Omega_{ADW}(i,j)
\left[p_i^t\log\frac{p_i^t}{p_i^s}+p_j^t\log\frac{p_j^t}{p_j^s}\right].
$$
The local objective becomes
$$
L_{Local}=L^{w}+L_{LLKI}.
$$

After the top-$d$ subset is removed, LDRLD distills the remaining non-target logits,
$$
\bar{H}^t=[Z_{d+1}^t,\ldots,Z_C^t],\qquad
\bar{H}^s=[Z_{d+1}^s,\ldots,Z_C^s],
$$
using
$$
L_{RNTK}=KL(\bar{H}^t,\bar{H}^s)=\sum_{i=d+1}^{C}\bar{p}_i^t\log\frac{\bar{p}_i^t}{\bar{p}_i^s},
$$
where the softmax is restricted to indices $d+1,\ldots,C$. The paper distinguishes this “remaining non-target knowledge” from DKD’s non-target KD: RNTK excludes the entire top-$d$ subset rather than excluding only the true target class, thereby reducing reliance on common or high-confidence categories and activating low-confidence classes.

With task loss
$$
L_{Task}=-\sum_{j=1}^{C}y_j\log p_j^s,
$$
the final objective is
$$
L_{LDRLD}=L_{Task}+\alpha L_{Local}+\beta L_{RNTK},
$$
where $\alpha$ and $\beta$ balance local relational transfer and remaining non-target transfer [2507.15911].

## 4. Optimization procedure, hyperparameters, and computational profile

The training pipeline is explicitly algorithmic. For each mini-batch, the teacher and student logits are computed; a local subset of size $d$ is built by repeatedly extracting the current top-1 logit of the student and masking it out; all class pairs inside that subset are generated; pairwise probabilities are computed via two-class softmax; the local relation loss with ADW and the LLKI loss are evaluated; the remaining non-target KL loss is computed on indices $d+1,\ldots,C$; and the total loss is backpropagated through the student [2507.15911].

The paper reports experiments on CIFAR-100, ImageNet-1K, Tiny-ImageNet, Market-1501, and MS-COCO2017. For CIFAR-100 and Tiny-ImageNet, training uses SGD with momentum $0.9$, weight decay $5\times 10^{-4}$, 240 epochs, learning-rate drops by $\times 0.1$ at epochs 150, 180, and 210, linear warm-up for 20 epochs, and temperature $\tau=4.0$. Batch sizes are 64 for CIFAR-100 and 128 for Tiny-ImageNet. The default recursion depth is $d=7$, except for ResNet32$\times$4$\rightarrow$ShuffleNetV1 where $d=9$. Typical CIFAR-100 values are $\alpha\in[6.5,11.5]$ and $\beta\in[1.0,8.5]$, with examples such as ResNet56$\rightarrow$ResNet20 using $\alpha=9.5,\beta=1.0$, ResNet32$\times$4$\rightarrow$ShuffleNetV2 using $\alpha=9.5,\beta=7.0$, and WRN-40-2$\rightarrow$WRN-16-2 using $\alpha=11.5,\beta=7.0$. For ImageNet-1K, the reported setup uses SGD, weight decay $1\times 10^{-4}$, 100 epochs, learning rate 0.1, warm-up for 10 epochs, batch size 256, and temperature $\tau=2.0$, with examples ResNet34$\rightarrow$ResNet18 using $\alpha=7.0,\beta=0.025$ and ResNet50$\rightarrow$MobileNetV1 using $\alpha=5.0,\beta=2.0$.

Sensitivity analyses identify recursion depth as a critical hyperparameter. Too small a $d$ under-covers relations, whereas too large a $d$ introduces noise and redundancy; best performance typically occurs at $d=7$. The addition of $\Omega_{ADW}$ consistently improves over uniform pair weighting, with an example on CIFAR-100 VGG13$\rightarrow$MobileNetV2 of $+0.32\%$ relative to $L_{Local}$ without ADW. The paper also reports that $L_{Local}$ and $L_{RNTK}$ each help individually and that their combination is strongest, with examples of $+4.70\%$ over baseline for ResNet32$\times$4$\rightarrow$ResNet8$\times$4 and $+3.00\%$ for WRN-40-2$\rightarrow$WRN-40-1 [2507.15911].

Computationally, pairwise relations among the top-$d$ subset cost $O(d^2)$ per sample, which is cheaper than modeling all $O(C^2)$ class pairs when $d\ll C$. The paper states that LDRLD uses no extra memory compared to KD and DKD, and reports the same GPU memory, 2052 MB on RTX 3090 in the reported setup. On CIFAR-100 with ResNet32$\times$4$\rightarrow$ResNet8$\times$4 on RTX 3090, average per-epoch runtime is 11.89 s for KD, 12.04 s for DKD, and 13.65 s for LDRLD, compared with 17.86 s for CRD and 23.44 s for ReviewKD. The method therefore adds modest overhead relative to KD and DKD while remaining substantially more efficient than feature-based distillation [2507.15911].

## 5. Empirical performance across classification, fine-grained recognition, detection, and re-identification

On CIFAR-100 with same-architecture transfers, LDRLD improves ResNet32$\times$4$\rightarrow$ResNet8$\times$4 from 73.33% under KD to 77.20% under LDRLD, WRN-40-2$\rightarrow$WRN-16-2 from 74.92% to 76.35%, WRN-40-2$\rightarrow$WRN-40-1 from 73.54% to 74.98%, and VGG13$\rightarrow$VGG8 from 72.98% to 75.06%. For different architectures on CIFAR-100, it improves ResNet50$\rightarrow$MobileNetV2 from 67.35% to 70.74%, ResNet32$\times$4$\rightarrow$ShuffleNetV2 from 74.45% to 77.33%, ResNet32$\times$4$\rightarrow$ShuffleNetV1 from 74.07% to 76.46%, and VGG13$\rightarrow$MobileNetV2 from 67.37% to 70.11% [2507.15911].

On ImageNet-1K, ResNet34$\rightarrow$ResNet18 increases from 70.66% top-1 and 89.88% top-5 under KD to 71.88% top-1 and 90.58% top-5 under LDRLD. For the heterogeneous transfer ResNet50$\rightarrow$MobileNetV1, KD yields 70.49% top-1 and 89.92% top-5, while LDRLD yields 73.12% top-1 and 91.43% top-5. The paper also notes that WTTM is slightly higher in same-architecture top-1, at 72.19 versus 71.88. On Tiny-ImageNet, VGG13$\rightarrow$VGG8 increases from 57.33% to 60.91%, WRN-40-2$\rightarrow$WRN-16-2 from 59.16% to 60.67%, and ResNet50$\rightarrow$MobileNetV2 from 60.02% to 60.31% [2507.15911].

The reported gains are larger in heterogeneous vision-transformer-to-CNN settings on CIFAR-100. Swin-T$\rightarrow$ResNet18 improves from 78.74% to 82.17%, ViT-S$\rightarrow$ResNet18 from 77.26% to 80.36%, Mixer-B/16$\rightarrow$ResNet18 from 77.79% to 80.69%, Swin-T$\rightarrow$MobileNetV2 from 74.68% to 81.64%, ViT-S$\rightarrow$MobileNetV2 from 72.77% to 79.21%, and Mixer-B/16$\rightarrow$MobileNetV2 from 73.33% to 80.64%. On fine-grained CUB-200, ResNet32$\times$4$\rightarrow$MobileNetV2 improves from 56.09% to 60.99%, ResNet32$\times$4$\rightarrow$ShuffleNetV1 from 61.68% to 65.19%, VGG13$\rightarrow$MobileNetV2 from 53.98% to 59.73%, and VGG13$\rightarrow$VGG8 from 64.18% to 68.27%. These results are consistent with the claim that denser local relations are especially useful for visually confusable categories [2507.15911].

The method is also evaluated beyond image classification. On MS-COCO2017 detection with Faster R-CNN FPN, R-101$\rightarrow$R-18 achieves AP 35.12 under LDRLD, compared with 33.97 for KD and 34.88 for DKD; R-101$\rightarrow$R-50 yields AP 39.31 under LDRLD, compared with 38.35 for KD and 39.01 for DKD. On Market-1501 re-identification, a ResNet18 student baseline has Rank-1 85.04 and mAP 65.30, while LDRLD improves Rank-1 by 3.27, Rank-5 by 0.99, Rank-10 by 0.80, and mAP by 6.83 over baseline. The overall picture reported in the paper is that LDRLD compares favorably with state-of-the-art logit-based distillation approaches across diverse tasks [2507.15911].

## 6. Relation to adjacent formulations, misconceptions, and scope

Within the KD literature, LDRLD is positioned as a logit-based alternative to both globally normalized KD and more costly feature-level relational methods. Relative to classical KD, the distinguishing operation is pairwise softmax over selected class pairs rather than a single global softmax. Relative to RKD and CRD, the method remains logit-based rather than feature-based, which the paper presents as the reason it retains simplicity and efficiency. Relative to DKD and NKD, the novelty lies in recursive decoupling and dense pairwise recombination of a top-$d$ local subset, combined with ADW and RNTK. Relative to dynamic-temperature approaches such as CTKD, LSKD, and WTTM, the novelty is not temperature control but local dense relational modeling with recursive selection and adaptive pair weighting [2507.15911].

Several nearby papers use related language but do not define the same method. “Linkless Link Prediction via Relational Distillation” formulates an anchor-centered relational KD framework for link prediction, using local dense candidate sets $C(a)$, a distribution-based matching loss, and a rank-based matching loss, but it operates over link targets around an anchor node rather than over class logits in a multiclass classifier [2210.05801]. “Logit Distance Bounds Representational Similarity” does not introduce the name LDRLD, yet it proves that matching all pairwise logit gaps is equivalent to logit-distance distillation and yields explicit guarantees for mean CCA and a representation dissimilarity $d_{\mathrm{rep}}$; in that sense, it supplies a theoretical interpretation of dense relational logit alignment, though not the recursive top-$d$ procedure or ADW of LDRLD [2602.15438]. “Localization Distillation for Dense Object Detection” is local, dense, and logit-level over FPN locations, but the paper explicitly states that it has no relational term in the usual sense; its mechanism is localization-logit KL with valuable localization region masking rather than pairwise class-relation modeling [2102.12252].

A recurring misconception is therefore that any local logit KD method qualifies as LDRLD. In the strict sense of the 2025 formulation, LDRLD refers to the specific combination of recursive top-$d$ extraction on student logits, dense pairwise recombination within the selected subset, ADW through IRW and ERD, LLKI over the selected logits, and RNTK over the excluded remainder. The paper also notes several limitations and failure modes: the recursion depth $d$ must be tuned manually; gains can be smaller in some large-scale settings with limited students, as illustrated by the ImageNet same-architecture case where WTTM slightly exceeds LDRLD in top-1; and when the student is capacity-limited, reducing $d$ or increasing $\beta$ may be necessary to avoid overwhelming the student with too many local pairs. The authors state that the code will be made publicly available [2507.15911].

Source: https://www.emergentmind.com/topics/local-dense-relational-logit-distillation-ldrld