pith. sign in

arxiv: 2603.28554 · v3 · submitted 2026-03-30 · 💻 cs.CV · cs.AI· cs.IR

Hydra: Unifying Document Retrieval and Generation in a Single Vision-Language Model

Pith reviewed 2026-05-14 21:23 UTC · model grok-4.3

classification 💻 cs.CV cs.AIcs.IR
keywords vision language modeldocument retrievaltext generationLoRA adapterunified modelmemory reductionColBERT retrievaldual head
0
0 comments X

The pith

A togglable LoRA adapter lets one vision-language model do both retrieval and generation while keeping generation weights identical to the base model.

A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.

The paper shows that document retrieval and autoregressive generation can be unified inside a single vision-language model. By training one LoRA adapter only on retrieval tasks, the model can switch modes at inference time: the adapter on produces multi-vector embeddings for retrieval, and off restores full generation capability. This matters because separate models for each task double the memory footprint and system complexity in applications like visual document understanding. The approach avoids common failure modes in fine-tuned models by handling attention and output heads structurally, achieving over 60 percent memory reduction at both 4B and 0.8B scales.

Core claim

Hydra is a dual-head vision-language model that supports ColBERT-style late-interaction retrieval alongside standard autoregressive generation from the same weights. A retrieval-only LoRA adapter is enabled to output multi-vector embeddings and disabled to recover the exact base model generation behavior, verified by byte-for-byte identity in all 426 language-model weight tensors. The design sidesteps attention-mode and lm_head issues structurally and handles KV-cache in the decode loop, demonstrated on Qwen3.5 backbones at two scales with consistent hyperparameters.

What carries the argument

The togglable single LoRA adapter that switches the model between producing multi-vector retrieval embeddings and performing standard text generation.

Load-bearing premise

Disabling the retrieval LoRA restores the original generation behavior exactly, without any weight modifications or further training.

What would settle it

Check whether all 426 language-model weight tensors remain byte-for-byte identical after disabling the LoRA and whether generated text sequences match the base model outputs on the same inputs.

read the original abstract

Visual document understanding typically requires separate retrieval and generation models, doubling memory and system complexity. We present Hydra, a dual-head approach that provides both ColBERT-style late-interaction retrieval and autoregressive generation from a single vision-language model. A single LoRA adapter, trained only for retrieval, is toggled at inference: enabling it produces multi-vector embeddings; disabling it recovers the base model's generation quality, with 426 of 426 language-model weight tensors byte-for-byte identical to a freshly-loaded Qwen3.5-4B. We identify two failure modes that can silently break generation in retrieval-fine-tuned VLMs (attention-mode restoration and lm_head preservation) plus an efficiency requirement (KV-cache-aware decoding); Hydra sidesteps the first two structurally and addresses the third in the decode loop. We release two scales, Hydra-4B and Hydra-0.8B, sharing LoRA hyperparameters (r=32, alpha=32) and optimisation recipe; data mix and projection dim differ across scales. The single-model design cuts peak GPU memory from 28.85 GB to 10.77 GB at 4B (62.7% reduction) and from 5.79 GB to 2.37 GB at 0.8B (59.1%) relative to a co-resident two-model deployment. A controlled ablation finds GritLM-style joint training matches Hydra's retrieval-only training on the evaluated modes while its LoRA-on generation mode collapses. A proof-of-concept on Qwen2.5-Omni-3B preserves generation equivalence on a non-Qwen3.5 backbone and transfers image retrieval within 2-8 pp of Hydra-4B, with zero-shot audio retrieval emerging through the frozen Whisper encoder.

Editorial analysis

A structured set of objections, weighed in public.

Desk editor's note, referee report, simulated authors' rebuttal, and a circularity audit. Tearing a paper down is the easy half of reading it; the pith above is the substance, this is the friction.

Referee Report

3 major / 2 minor

Summary. The paper presents Hydra, a dual-head vision-language model (Hydra-4B and Hydra-0.8B) that unifies ColBERT-style late-interaction retrieval and autoregressive generation within a single VLM. A single LoRA adapter (r=32, alpha=32) is trained exclusively for retrieval; at inference it is toggled on to produce multi-vector embeddings or off to recover the base Qwen3.5-4B generation behavior, with all 426 language-model weight tensors remaining byte-for-byte identical. The approach structurally sidesteps two identified failure modes (attention-mode restoration and lm_head preservation) and handles KV-cache decoding in the loop, yielding 62.7% and 59.1% peak-GPU-memory reductions versus separate retrieval+generation models. Ablations compare retrieval-only training to GritLM-style joint training, and a proof-of-concept transfers the method to Qwen2.5-Omni-3B while preserving generation equivalence and enabling zero-shot audio retrieval.

Significance. If the byte-for-byte weight-identity and generation-equivalence claims are verified, Hydra demonstrates a practical route to task unification that halves memory footprint for document-understanding pipelines without sacrificing either retrieval or generation quality. The explicit structural handling of failure modes, shared LoRA recipe across scales, and cross-backbone proof-of-concept are notable engineering contributions. The reported memory savings and emergent audio-retrieval capability would be of immediate interest to the vision-language and retrieval communities.

major comments (3)
  1. [Abstract / §4] Abstract and §4 (failure-mode section): the claim that toggling off the retrieval LoRA fully restores base-model generation quality rests on structural sidesteps for attention-mode restoration and lm_head preservation, yet no concrete description is given of which attention flags, head tensors, or isolation steps are applied. This detail is load-bearing for the 426/426 byte-for-byte identity assertion and must be supplied with explicit verification (e.g., generation perplexity or token-level equivalence metrics on a held-out set).
  2. [Ablation paragraph] Ablation paragraph: the statement that GritLM-style joint training “matches Hydra’s retrieval-only training on the evaluated modes while its LoRA-on generation mode collapses” lacks any quantitative retrieval scores, generation metrics, or error bars. Without these numbers the ablation cannot support the superiority claim for retrieval-only training.
  3. [Proof-of-concept paragraph] Proof-of-concept paragraph: the transfer to Qwen2.5-Omni-3B is reported to preserve generation equivalence and achieve image-retrieval performance within 2–8 pp of Hydra-4B, but the manuscript provides no implementation details on how KV-cache-aware decoding or the structural sidesteps are realized on this non-Qwen3.5 backbone.
minor comments (2)
  1. [Abstract] Abstract: the phrase “426 of 426 language-model weight tensors” should explicitly state whether vision-projection or other shared components are excluded from this count.
  2. [Methods] Methods: the differing data mix and projection dimension across the 4B and 0.8B scales are noted but not tabulated; a small table listing these hyperparameters per scale would improve reproducibility.

Simulated Author's Rebuttal

3 responses · 0 unresolved

We thank the referee for the constructive review and for highlighting areas where additional detail would strengthen the manuscript. We have revised the paper to supply the requested concrete descriptions, quantitative ablation results, and implementation details for the proof-of-concept. Each point is addressed below.

read point-by-point responses
  1. Referee: [Abstract / §4] the claim that toggling off the retrieval LoRA fully restores base-model generation quality rests on structural sidesteps for attention-mode restoration and lm_head preservation, yet no concrete description is given of which attention flags, head tensors, or isolation steps are applied. This detail is load-bearing for the 426/426 byte-for-byte identity assertion and must be supplied with explicit verification (e.g., generation perplexity or token-level equivalence metrics on a held-out set).

    Authors: We agree the original text was insufficiently explicit. In the revised §4 we now enumerate the exact steps: (1) attention-mode restoration is achieved by forcing attn_implementation='eager' only when the retrieval LoRA is active and reverting to 'sdpa' when it is disabled; (2) lm_head is isolated by excluding it from the LoRA target modules and freezing its weights throughout training; (3) all 426 language-model tensors are verified byte-for-byte identical via direct state-dict comparison. We add token-level equivalence results on a 1 000-document held-out set (100 % exact token match, perplexity delta < 0.01) and include the verification script in the released code. revision: yes

  2. Referee: [Ablation paragraph] the statement that GritLM-style joint training “matches Hydra’s retrieval-only training on the evaluated modes while its LoRA-on generation mode collapses” lacks any quantitative retrieval scores, generation metrics, or error bars.

    Authors: We accept the criticism. The revised ablation section now contains Table 3 reporting NDCG@10, generation perplexity, and exact-match scores for both training regimes across three random seeds (mean ± std). Retrieval performance is statistically indistinguishable (Hydra 0.712 ± 0.008 vs. joint 0.705 ± 0.011), while the joint-training LoRA-on generation mode shows a 47 % rise in perplexity and complete collapse on long-form outputs, confirming the superiority claim with the requested quantitative support. revision: yes

  3. Referee: [Proof-of-concept paragraph] the transfer to Qwen2.5-Omni-3B is reported to preserve generation equivalence and achieve image-retrieval performance within 2–8 pp of Hydra-4B, but the manuscript provides no implementation details on how KV-cache-aware decoding or the structural sidesteps are realized on this non-Qwen3.5 backbone.

    Authors: We have expanded the proof-of-concept paragraph and added Appendix C. The same KV-cache-aware decode loop is used; modality-specific adapters are registered via a backbone-agnostic hook that toggles attention implementation and freezes lm_head identically to the Qwen3.5 case. Generation equivalence is verified by perplexity match within 0.5 % and 100 % token identity on a 500-example audio-visual test set. The structural sidesteps therefore generalize without backbone-specific code changes. revision: yes

Circularity Check

0 steps flagged

No circularity; method uses standard LoRA toggling with explicit weight identity by construction

full rationale

The paper's central claim—that a retrieval-only LoRA adapter can be toggled off to recover exact base-model generation with 426/426 LM tensors byte-for-byte identical—follows directly from the definition of LoRA (additive adapter, base weights untouched during training). This is not a derived prediction but a structural property of the training setup. No equations, self-citations, or fitted parameters reduce the unification result to its own inputs. Failure-mode sidesteps and KV-cache handling are presented as explicit design choices, not self-referential derivations. The approach is self-contained against external benchmarks of LoRA mechanics.

Axiom & Free-Parameter Ledger

2 free parameters · 1 axioms · 0 invented entities

The central claim rests on the assumption that a retrieval-only LoRA can be structurally isolated so that its removal leaves the base language-model weights untouched; no new physical entities or mathematical axioms beyond standard transformer and LoRA mechanics are introduced.

free parameters (2)
  • LoRA rank r
    Hyperparameter set to 32 for the retrieval adapter; chosen rather than derived.
  • LoRA alpha
    Scaling factor set to 32; chosen rather than derived.
axioms (1)
  • domain assumption Disabling the retrieval LoRA restores the exact original generation behavior of the base VLM without any weight modification.
    Invoked when stating that 426 of 426 tensors remain byte-for-byte identical.

pith-pipeline@v0.9.0 · 5619 in / 1391 out tokens · 33736 ms · 2026-05-14T21:23:14.186737+00:00 · methodology

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.