Papers
Topics
Authors
Recent
Search
2000 character limit reached

Dynamic Inverted Softmax (DIS)

Updated 31 January 2026
  • Dynamic Inverted Softmax (DIS) is an adaptive normalization technique that dynamically reweights similarities to mitigate hubness and boost retrieval accuracy in cross-modal tasks.
  • DIS leverages codeword-structured, query-dependent sampling in large-class softmax, reducing computational cost and bias while enabling efficient sublinear sampling.
  • DIS is integrated into end-to-end systems to improve robustness under distributional shifts, achieving significant speedups and enhanced performance in extreme classification scenarios.

Dynamic Inverted Softmax (DIS) encompasses a set of adaptive normalization techniques designed to improve both retrieval accuracy and computational efficiency in high-dimensional embedding spaces. DIS is prominent in two central application domains: Robust cross-modal retrieval with hubness mitigation as formalized in Querybank Normalisation (QB-Norm), and large-scale learning/inference acceleration via adaptive sampled softmax algorithms such as the MIDX-Sampler. Both methods employ dynamic, query-dependent mechanisms to suppress hubs selectively or to construct efficient proposal distributions for importance sampling, yielding robust performance under distributional shift and extreme data cardinality.

1. Mathematical Formulation and Derivation

The DIS mechanism was introduced in two distinct but conceptually aligned modalities: embedding space normalisation for cross-modal retrieval (Bogolin et al., 2021) and adaptive sampled softmax for extreme classification and large-scale neural models (Chen et al., 15 Jan 2025).

DIS in Cross-Modal Retrieval

Given encoders fq:mqRCf_q : m_q \to \mathbb{R}^C and fg:mgRCf_g : m_g \to \mathbb{R}^C mapping queries and gallery items into a joint CC-dimensional space, the base similarity is

sq(j)=sim(fq(q),fg(gj))s_q(j) = \mathrm{sim}(f_q(q), f_g(g_j))

A querybank B={bi}i=1NB = \{b_i\}_{i=1}^N of NN probes is constructed. Each gallery item gjg_j receives a probe vector pj(i)=sim(fq(bi),fg(gj))p_j(i) = \mathrm{sim}(f_q(b_i), f_g(g_j)). The static Inverted Softmax (IS) normalises gallery similarities as

ηqIS(j)=exp(βsq(j))i=1Nexp(βpj(i))\eta_q^{\mathrm{IS}}(j) = \frac{\exp(\beta s_q(j))}{\sum_{i=1}^N \exp(\beta p_j(i))}

DIS introduces a data-driven activation set A\mathcal{A} comprising gallery items receiving top-fg:mgRCf_g : m_g \to \mathbb{R}^C0 votes by the querybank probes. For a given query, DIS reweights only if the top raw-similarity hit fg:mgRCf_g : m_g \to \mathbb{R}^C1 is itself a hub (fg:mgRCf_g : m_g \to \mathbb{R}^C2):

fg:mgRCf_g : m_g \to \mathbb{R}^C3

DIS in Adaptive Sampled Softmax (MIDX-Sampler)

For large-class softmax, let queries be fg:mgRCf_g : m_g \to \mathbb{R}^C4, classes fg:mgRCf_g : m_g \to \mathbb{R}^C5, and scores fg:mgRCf_g : m_g \to \mathbb{R}^C6. The ideal softmax is

fg:mgRCf_g : m_g \to \mathbb{R}^C7

To enable efficient sampling, DIS decomposes fg:mgRCf_g : m_g \to \mathbb{R}^C8 via product or residual quantization. With fg:mgRCf_g : m_g \to \mathbb{R}^C9 codewords per block and CC0 blocks, each class is mapped to CC1, and CC2 contains class indices sharing codeword assignments. The dynamic (DIS) proposal distribution replaces the residual softmax by a uniform:

CC3

Sampling and importance weighting are done sublinearly in CC4.

2. Comparison of DIS to Static Methods

DIS techniques provide targeted hub penalisation and adaptivity not present in their static analogues:

  • Static IS divides all similarities by a hubness denominator for every gallery, regardless of actual hub status, often resulting in over-penalisation for poor or mismatched querybanks (Bogolin et al., 2021).
  • DIS (QB-Norm) applies softmax only when a query's top result is a flaggable hub; otherwise, raw scoring is retained, increasing robustness to querybank/galleries with domain mismatch or low overlap.
  • Static proposals in sampled softmax (uniform, unigram) exhibit large KL and gradient biases, poor convergence, and slow optimisation (Chen et al., 15 Jan 2025). DIS via MIDX-Sampler achieves codeword-structured adaptivity, reducing bias and preserving computational efficiency.

3. Algorithms and Implementation

QB-Norm DIS Inference Pipeline

Precompute probe similarities and the activation set CC5. At inference:

NN8

MIDX-Sampler DIS Workflow

Construct product/residual quantization codebooks. For each query, sample negatives per codeword distribution and evaluate the dynamic proposal CC6:

NN9

4. Hyperparameters and Selection Criteria

Key DIS parameters determine both performance and generalisation properties:

Hyperparameter Role in QB-Norm DIS(Bogolin et al., 2021) Role in MIDX-Sampler DIS(Chen et al., 15 Jan 2025)
Inverse temperature (CC7) Controls peakiness; optimal around 20 (or CC8 for CLIP models) Implicit in codeword inner products capacity
Querybank size (CC9) sq(j)=sim(fq(q),fg(gj))s_q(j) = \mathrm{sim}(f_q(q), f_g(g_j))0–sq(j)=sim(fq(q),fg(gj))s_q(j) = \mathrm{sim}(f_q(q), f_g(g_j))1 probes; saturates at sq(j)=sim(fq(q),fg(gj))s_q(j) = \mathrm{sim}(f_q(q), f_g(g_j))2 Codebook size sq(j)=sim(fq(q),fg(gj))s_q(j) = \mathrm{sim}(f_q(q), f_g(g_j))3 (balancing distortion and speed)
Top-sq(j)=sim(fq(q),fg(gj))s_q(j) = \mathrm{sim}(f_q(q), f_g(g_j))4 selection sq(j)=sim(fq(q),fg(gj))s_q(j) = \mathrm{sim}(f_q(q), f_g(g_j))5 gives maximal robustness Not applicable; uniform sampling at codeword level
Similarity measure Cosine similarity in sq(j)=sim(fq(q),fg(gj))s_q(j) = \mathrm{sim}(f_q(q), f_g(g_j))6 Inner product in sq(j)=sim(fq(q),fg(gj))s_q(j) = \mathrm{sim}(f_q(q), f_g(g_j))7

Selection is typically done via held-out validation; increasing sq(j)=sim(fq(q),fg(gj))s_q(j) = \mathrm{sim}(f_q(q), f_g(g_j))8 or sq(j)=sim(fq(q),fg(gj))s_q(j) = \mathrm{sim}(f_q(q), f_g(g_j))9 reduces hubness and quantization distortion but incurs additional memory.

5. Integration in End-to-End Systems

QB-Norm Pipeline

  • Training: Encoders B={bi}i=1NB = \{b_i\}_{i=1}^N0, B={bi}i=1NB = \{b_i\}_{i=1}^N1 learned via standard ranking/contrastive loss.
  • Indexing: Gallery embeddings and querybank fixed; probe similarities and activation set precomputed.
  • Inference: Queries scored and ranked via DIS; no retraining or parameter updates required.

Sampled Softmax for Large-Scale Learning

  • Index construction: Product/residual quantization codebooks computed offline.
  • Proposal decomposition: DIS enables sublinear sampling and softmax approximation, reducing both bias and compute.
  • Training/inference: Gradient estimation and prediction performed on dynamically sampled negatives.

6. Empirical Performance and Robustness

  • Video-text retrieval (MSR-VTT): R@1 improves from B={bi}i=1NB = \{b_i\}_{i=1}^N2; CLIP2Video improves R@1 B={bi}i=1NB = \{b_i\}_{i=1}^N3.
  • Recall increases: Across six video-text datasets, all recall metrics rise by B={bi}i=1NB = \{b_i\}_{i=1}^N4–B={bi}i=1NB = \{b_i\}_{i=1}^N5 points.
  • Image/text/audio tasks: CLIP zero-shot on MSCOCO R@1 improves B={bi}i=1NB = \{b_i\}_{i=1}^N6; text-audio retrieval rises B={bi}i=1NB = \{b_i\}_{i=1}^N7.
  • Hubness reduction: Example: MSR-VTT B={bi}i=1NB = \{b_i\}_{i=1}^N8-occurrence skewness drops B={bi}i=1NB = \{b_i\}_{i=1}^N9.

Robustness to Distributional Shift:

  • DIS preserves baseline performance under far-domain querybanks, unlike static IS or CSLS which collapse (Bogolin et al., 2021).
  • Ablations show smooth degradation away from NN0, querybank size saturation, and maximum robustness at NN1.
  • Sampling cost: NN2, sublinear in number of classes.
  • Bias/convergence: KL-divergence and gradient bias provably bounded; smaller residual distortion NN3 leads to superior generalisation and faster convergence.
  • Empirical speedup: MIDX-Sampler matches full softmax in perplexity, ranking, and recall with NN4–NN5 sampling and NN6–NN7 memory improvements over kernel methods.

7. Context, Significance, and Current Challenges

Dynamic Inverted Softmax provides modular, data-driven normalisation strategies that bypass limitations of static global transformations. In retrieval, DIS robustly demotes hubs only where necessary, preserving performance under query/resource limitations and domain mismatch. In sampled softmax, DIS enables scalable, theoretically justified learning for extreme class cardinality. These mechanisms require no retraining or backpropagation through the normaliser, making them practical augmentations for existing neural models.

A plausible implication is that future extensions may leverage learnable codeword assignment and additional adaptivity in sampling or hub detection to further reduce bias and accelerate convergence. Current limitations include memory footprint for large querybanks/codebooks and sensitivity to quantization or probe selection. Nevertheless, the empirical consistency and theoretical foundation make DIS central to both retrieval and extreme learning architectures (Bogolin et al., 2021, Chen et al., 15 Jan 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (2)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Dynamic Inverted Softmax (DIS).