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 (VLM). 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 -- byte-identical outputs in 100% of 10,500 greedy and stochastic samples, with max delta-ANLS = 0.0044 across 15,301 samples on four VQA benchmarks (three informative; ChartQA is near-zero for both models under greedy decoding) when compared against an independent base-model pipeline. We identify three engineering requirements (attention-mode restoration, lm_head preservation, KV-cache-aware decoding) whose omission silently breaks generation despite correct weight recovery. On ViDoRe V1, Hydra (4B) is within 1 percentage point of a controlled single-head baseline in a single training run, with higher aggregate scores on V2 and V3 that are concentrated on a subset of tasks; multi-seed experiments are needed to confirm these trends. The single-model design reduces peak GPU memory by 41%, though adapter switching introduces throughput overhead under concurrent serving loads. An ablation shows that GritLM-style joint training provides no benefit within the LoRA-based (r=16) training regime. A proof-of-concept extension to Qwen2.5-Omni-3B demonstrates that the mechanism generalizes to audio retrieval and video embedding, with speech generation.
翻译:视觉文档理解通常需要独立的检索和生成模型,这会使内存和系统复杂度加倍。我们提出Hydra,一种双头方法,能在单一视觉语言模型(VLM)中同时提供ColBERT风格的晚期交互检索和自回归生成。一个仅针对检索训练的LoRA适配器在推理时进行切换:启用它可生成多向量嵌入;禁用它则恢复基础模型的生成质量——在与独立基础模型流水线比较时,在贪婪和随机采样的10,500个样本中100%产生字节相同的输出,且在四个VQA基准的15,301个样本中(三个信息性基准;在贪婪解码下,两个模型的ChartQA均接近零),最大Δ-ANLS = 0.0044。我们识别出三个工程要求(注意力模式恢复、lm_head保留、KV缓存感知解码),若忽略它们,即使权重正确恢复,生成也会悄无声息地失败。在ViDoRe V1上,单次训练中Hydra(4B)与受控单头基础模型之间的差距在1个百分点内,其在V2和V3上的更高聚合分数集中于任务子集;需要多种子实验来确认这些趋势。单模型设计将峰值GPU内存降低了41%,但适配器切换会在并发服务负载下引入吞吐量开销。消融实验表明,在基于LoRA(r=16)的训练范式中,GritLM风格的联合训练未提供任何益处。扩展到Qwen2.5-Omni-3B的概念验证实验表明,该机制可泛化至音频检索和视频嵌入,并支持语音生成。