Papers
Topics
Authors
Recent
Search
2000 character limit reached

LogQ Algorithm: Distinct Methods Overview

Updated 6 July 2026
  • LogQ algorithm is a polysemous term that denotes distinct methods including log-correction in sampled softmax retrieval and logarithmic qubit encoding for QUBO optimization.
  • In retrieval systems, the logQ correction subtracts the log-probability from logits to counteract over-penalization of frequent negatives, enhancing high-k recall performance.
  • For QUBO problems, LogQ employs amplitude encoding with logarithmic qubit scaling, offering exponential qubit savings compared to traditional methods and paving the way for classical reformulations.

Searching arXiv for papers using “LogQ” across domains. {} The expression “LogQ algorithm” does not denote a single standardized method in the contemporary arXiv literature. It is used for several technically distinct constructions that share a logarithmic, log-corrected, or logarithmic-resource interpretation: a sampled-softmax bias correction for large-scale retrieval, a logarithmic-qubit variational encoding for QUBO and its later quantum-inspired reformulation, and closely related logarithmic quantization schemes such as LogQuant and Logb_bQuant for LLM inference (Khrylchenko et al., 12 Jul 2025, Messud et al., 14 Apr 2026, Chen et al., 25 Mar 2025, Bohn et al., 1 Jul 2026). This suggests that the term is polysemous rather than canonical.

1. Terminological scope

In one major usage, “logQ” refers to a correction applied to sampled softmax when negatives are drawn from a proposal distribution QQ, especially the in-batch distribution in two-tower retrieval systems. In another, “LogQ” denotes a variational method for QUBO that uses only N=log2nN=\lceil \log_2 n\rceil qubits through amplitude encoding, and later a fully classical reformulation of the same phase-based construction. Closely related names, notably LogQuant and Logb_bQuant, are used for logarithmic quantization of KV cache and model weights rather than for the retrieval or QUBO procedures themselves (Khrylchenko et al., 12 Jul 2025, Chatterjee et al., 11 Jul 2025, Messud et al., 14 Apr 2026, Chen et al., 25 Mar 2025, Bohn et al., 1 Jul 2026).

Usage Core object Representative papers
logQ correction Sampled softmax with in-batch negatives (Khrylchenko et al., 12 Jul 2025)
LogQ for QUBO Amplitude-encoded variational optimization (Chatterjee et al., 11 Jul 2025, Messud et al., 14 Apr 2026)
LogQuant 2-bit KV-cache compression (Chen et al., 25 Mar 2025)
Logb_bQuant Logarithmic weight quantization (Bohn et al., 1 Jul 2026)

A recurring misconception is that these works describe variants of one algorithm. They do not. The shared label arises from different uses of “log”: logQ(d)\log Q(d) correction in retrieval, logarithmic qubit scaling in QUBO, and logarithmic codebooks in quantization. A careful reading of notation is therefore necessary before importing results across domains.

2. logQ correction in large-scale retrieval

In retrieval systems, the LogQ algorithm is the “widely used industry fix” for the bias induced by sampled softmax with in-batch negatives. The setting is the standard two-tower model

fθ(u,d)=gθ(u),hθ(d),f_\theta(u,d)=\langle g_\theta(u),\,h_\theta(d)\rangle,

trained to make the positive item score larger than scores of all other catalog items. Full softmax over the item set D\mathcal D is the ideal objective, but it is infeasible when D|\mathcal D| is in the millions, so training uses sampled softmax and, in practice, in-batch negatives. Because in-batch negatives follow the empirical item frequency in the training stream, popular items appear more often as negatives and are over-penalized (Khrylchenko et al., 12 Jul 2025).

The classical logQ correction addresses this mismatch by importance sampling. If negatives are sampled from Q(d)Q(d), then

QQ0

which motivates corrected logits

QQ1

The standard logQ-corrected loss is

QQ2

The paper also notes a widely implemented variant that omits the positive correction in the denominator. In both forms, the operational idea is the same: subtract QQ3 so that oversampled negatives receive reduced influence. The derivation matches the full-softmax gradient asymptotically as the number of negatives QQ4 (Khrylchenko et al., 12 Jul 2025).

Within this literature, “logQ” therefore does not mean logarithmic resource scaling or logarithmic quantization. It means a proposal-distribution correction inside sampled-softmax training.

3. Refined logQ and the finite-sample bias problem

The 2025 revision of logQ argues that the standard derivation overlooks a crucial detail: the positive item is not Monte Carlo sampled from QQ5; it is always present with probability QQ6. The paper rewrites the full-softmax gradient as

QQ7

so the exact gradient is scaled by the model’s misclassification probability QQ8. Standard logQ instead produces a factor QQ9, where N=log2nN=\lceil \log_2 n\rceil0 is computed from the sampled denominator that includes the positive. The paper’s claim is that standard logQ is asymptotically consistent but still biased for practical finite N=log2nN=\lceil \log_2 n\rceil1 because it effectively applies importance sampling to the positive “twice” (Khrylchenko et al., 12 Jul 2025).

The refined correction removes the positive from the denominator and introduces an explicit sample weight

N=log2nN=\lceil \log_2 n\rceil2

with stop-gradient. The resulting loss is

N=log2nN=\lceil \log_2 n\rceil3

where N=log2nN=\lceil \log_2 n\rceil4 and N=log2nN=\lceil \log_2 n\rceil5 excludes the positive. The weight has an interpretable semantics: it is the probability that the current model misclassifies the positive. This makes the correction a weighted log-softmax over negatives rather than a symmetric logit shift over both positive and negative terms (Khrylchenko et al., 12 Jul 2025).

Empirically, the refined correction is reported to improve both academic and industrial retrieval benchmarks. On MovieLens-1M and Steam, improved logQ with in-batch or mixed negatives typically performs as well or better than standard logQ. In a production music-retrieval system, the paper reports that consumption Recall@1000 rises from N=log2nN=\lceil \log_2 n\rceil6 to N=log2nN=\lceil \log_2 n\rceil7, and engagement Recall@1000 from N=log2nN=\lceil \log_2 n\rceil8 to N=log2nN=\lceil \log_2 n\rceil9, when moving from standard logQ to improved logQ. The same study emphasizes that high-b_b0 recall is the more relevant operating point for retrieval pipelines, even if performance at b_b1 can be similar or slightly lower (Khrylchenko et al., 12 Jul 2025).

A second misconception follows from the term’s industrial familiarity: standard logQ is often treated as if it fully debiased in-batch sampling. The 2025 analysis explicitly rejects that interpretation.

4. LogQ for QUBO: logarithmic qubit scaling and variational encoding

In quantum combinatorial optimization, LogQ refers to a different construction altogether. Here the target problem is spin-QUBO,

b_b2

with symmetric b_b3. The distinctive claim of LogQ is that it represents the b_b4 binary variables on only

b_b5

qubits by amplitude encoding rather than computational-basis encoding. The variational state is written as

b_b6

and the optimized phases encode the discrete solution through

b_b7

The cost function is

b_b8

with b_b9 obtained from a Pauli decomposition of b_b0 (Messud et al., 14 Apr 2026).

The appeal of this formulation is resource scaling. The improved-LogQ study states that QAOA uses b_b1 qubits for an b_b2-variable QUBO, whereas LogQ uses b_b3, and that the number of CNOTs scales as b_b4 for LogQ versus b_b5 for MaxCut in QAOA. This is the basis for the claim that LogQ uses exponentially fewer qubits than QAOA, although it does not remove all bottlenecks because the observable still requires Pauli decomposition and measurement (Chatterjee et al., 11 Jul 2025).

The main obstacle in the original quantum formulation was optimization. The original encoding function b_b6 was a step function,

b_b7

so b_b8 almost everywhere. The corresponding cost landscape is effectively flat for gradient-based methods, forcing the use of genetic algorithms or other global heuristics. The 2025 improvement replaces this with sigmoid-based parameterizations, first

b_b9

and then the “distorted” form

logQ(d)\log Q(d)0

which was designed so that logQ(d)\log Q(d)1, logQ(d)\log Q(d)2, large intervals retain non-small gradients, and small gradients occur only where the cost is close to an extremum. The optimization is then performed with a “gradient-inspired” method, specifically Cobyla, followed by a sharpening stage with logQ(d)\log Q(d)3 to drive logQ(d)\log Q(d)4 toward logQ(d)\log Q(d)5 or logQ(d)\log Q(d)6 (Chatterjee et al., 11 Jul 2025).

On MaxCut instances, this change materially affects optimization quality. For logQ(d)\log Q(d)7, logQ(d)\log Q(d)8, and logQ(d)\log Q(d)9, the paper reports objective values of fθ(u,d)=gθ(u),hθ(d),f_\theta(u,d)=\langle g_\theta(u),\,h_\theta(d)\rangle,0, fθ(u,d)=gθ(u),hθ(d),f_\theta(u,d)=\langle g_\theta(u),\,h_\theta(d)\rangle,1, and fθ(u,d)=gθ(u),hθ(d),f_\theta(u,d)=\langle g_\theta(u),\,h_\theta(d)\rangle,2 for LogQ-grad, versus fθ(u,d)=gθ(u),hθ(d),f_\theta(u,d)=\langle g_\theta(u),\,h_\theta(d)\rangle,3, fθ(u,d)=gθ(u),hθ(d),f_\theta(u,d)=\langle g_\theta(u),\,h_\theta(d)\rangle,4, and fθ(u,d)=gθ(u),hθ(d),f_\theta(u,d)=\langle g_\theta(u),\,h_\theta(d)\rangle,5 for original LogQ with a genetic algorithm under comparable runtime budgets (Chatterjee et al., 11 Jul 2025).

5. Classical reformulation: LogQ as a non-linear continuous relaxation

A later development removes the quantum device entirely while preserving the same phase-based encoding. The 2026 paper shows that LogQ can be reformulated as a fully classical heuristic. Instead of measuring

fθ(u,d)=gθ(u),hθ(d),f_\theta(u,d)=\langle g_\theta(u),\,h_\theta(d)\rangle,6

on a quantum computer, one directly minimizes

fθ(u,d)=gθ(u),hθ(d),f_\theta(u,d)=\langle g_\theta(u),\,h_\theta(d)\rangle,7

with the same phase parametrization fθ(u,d)=gθ(u),hθ(d),f_\theta(u,d)=\langle g_\theta(u),\,h_\theta(d)\rangle,8. The key identity is

fθ(u,d)=gθ(u),hθ(d),f_\theta(u,d)=\langle g_\theta(u),\,h_\theta(d)\rangle,9

so, up to an additive constant, the relaxed objective becomes

D\mathcal D0

The paper emphasizes that this is “no longer a linear relaxation”; it is a non-linear continuous relaxation on the complex unit circle (Messud et al., 14 Apr 2026).

The practical significance is negative as well as positive. On the positive side, Pauli decomposition, quantum state preparation, and measurement overhead disappear. On the negative side, the method remains nonconvex and heuristic, and the paper explicitly states that it provides no approximation guarantees or convergence theorems. The intended optimization class is “gradient-inspired” or perturbed-gradient methods, reusing the same design conditions on D\mathcal D1 that had been introduced for the improved quantum formulation (Messud et al., 14 Apr 2026).

This reformulation also clarifies a second misconception: logarithmic qubit scaling does not by itself make the original quantum LogQ computationally simple. The measurement bottleneck was serious enough that the same ansatz could motivate a purely classical algorithm.

Closely related names have proliferated in LLM systems, but they denote distinct algorithms. “LogQuant” is a training-free 2-bit KV-cache quantization method that keeps at most D\mathcal D2 tokens in full precision using a log-distributed retention rule and stores the rest in INT2 through the Quanto backend. Its streaming update is based on a recurrent density-halving rule: D|\mathcal D|0 The method reports that it “enhances throughput by 25% and boosts batch size by 60% without increasing memory consumption,” and for Math and Code Completion it reports “40% to 200%” relative accuracy improvement at the same compression ratio over comparable techniques. These are logarithmic quantization ideas, but they are not the retrieval logQ correction and not the QUBO LogQ ansatz (Chen et al., 25 Mar 2025).

“LogD\mathcal D3Quant” is a different logarithmic quantizer for LLM weights. It defines

D\mathcal D4

and

D\mathcal D5

Its tensor-wise base is chosen as

D\mathcal D6

with D\mathcal D7 determined by an energy-based pruning rule. The reported outcome is superior 4-bit performance versus asymmetric linear quantization at tensor-wise granularity, together with “moderate speedup and high memory savings”; for example, the paper gives 62.6% memory savings for Llama-3.1-8B and 65.0% for Qwen3-14B (Bohn et al., 1 Jul 2026).

Outside these better-defined usages, the label also appears informally. A 2021 engineering-design paper describes Logspace Sequential Quadratic Programming as “essentially what you refer to as a ‘LogQ algorithm’: SQP run in log-space with a specially constructed quadratic subproblem,” and reports a 40–70% reduction in number of iterations compared to SQP for the cases studied (Karcher, 2021). A different neighboring usage appears in maximum D\mathcal D8-likelihood estimation for Weibull parameters, where the objective is

D\mathcal D9

optimized by a genetic algorithm (Çankaya et al., 2020). This broader pattern suggests that “LogQ algorithm” functions more as a descriptive label than as a uniquely identified method.

The term therefore has to be interpreted locally. In recommender systems, it denotes a log-proposal correction for sampled softmax. In quantum combinatorial optimization, it denotes a logarithmic-qubit phase-encoding scheme for QUBO, now also reinterpreted as a classical non-linear relaxation. In LLM systems, related names denote logarithmic quantizers for KV cache or weights. Treating these as interchangeable obscures the core methodological point of each line of work.

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 LogQ Algorithm.