iclr 2024 spotlight  reviewer 评分 6668

1 intro

  • 在CV领域,很多Vision-language Model 会把来自图像的Embedding输入给LLM,并让LLM作为Decoder输出文字、类别、检测框等
    • 但是在这些模型中,LLM并不会直接处理来自图像的Token,需要和语言进行交互才可以
    • ——>论文探索的是:LLMs能否有效地直接处理完全基于视觉的任务,而不依赖于语言?(即LLM直接作为Encoder
  • 和现有Vision-language Models的区别
    • 现有vision-language model研究如何把视觉embedding输入给LLM(把视觉表征在语言空间对齐)
    • 论文研究聚焦如何提供更好的embedding
  • LLM中的冻结Transformer块在许多不同模态、任务的Encoder上都有用

    • 2D语义:图像分类 (image classification)
    • 点云:点云分类 (point cloud classification)
    • 视频:动作识别 (action recognition)
    • 无语义,回归任务:轨迹预测 (motion forecasting)
    • 2D多模态:2D VQA和图像搜索 (2D VQA and Retrieval)
    • 3D多模态:3D VQA

2 方法

2.1 与视觉语言模型的比较 

  • 论文提出的方法乍一看似乎与最近的视觉语言模型(VLMs)相似,其中线性层直接将视觉特征投影到LLMs的输入空间中。
    • 然而,论文提出的方法是不同的,因为线性层不一定将视觉表示z对齐到语言空间中。(也不是将视觉embedding输入给LLM)
    • 具体而言,这体现在三个方面:
      • (1)视觉预训练的独立性。论文提出的方法支持从头开始训练,不依赖于像CLIP这样的预训练视觉编码器。
      • (2)语言的独立性。论文提出的方法可以在没有基于语言的输入或提示的情况下运行,并且它适用于一般的视觉表示学习,而不仅仅是视觉语言任务。
      • (3)转换块的独立性。以前的VM将LLM视为一个连贯的模块,而我们的框架将每个Transformer块分离为一个独立的视觉编码层

2.2 与LLMs的比较

  • 由于视觉和文本数据之间的不同格式,论文大大改变了LLM Transformer的行为。
    • (1)注意力掩码。LLMs通常利用自回归掩码来模拟文本生成的顺序。
      • 然而,视觉数据中的标记一次性出现,例如猫的图像标记。
      • ——>论文放弃自回归注意力掩码,仅使用注意力掩码来指示填充标记。
    • (2)位置嵌入。LLMs中的位置嵌入,例如LLaMA中的旋转位置嵌入,不是视觉编码器的常见选项。
      • ——>为简单起见和与原始视觉骨干的一致性而删除LLMs的位置嵌入。
  • 该改进对视觉任务仍然产生了积极影响。

3 实验

3.1 图像分类

ViT模型的准确性在合并冻结的LLaMA Transformer块后持续提高

3.2 点云识别

3.3 动作识别

3.4 姿势预测

3.5 2D VQA & 3D VQA

transformers
huggingface/transformers: 是一个基于 Python 的自然语言处理库,它使用了 PostgreSQL 数据库存储数据。适合用于自然语言处理任务的开发和实现,特别是对于需要使用 Python 和 PostgreSQL 数据库的场景。特点是自然语言处理库、Python、PostgreSQL 数据库。

3.6 LLM transformer 层 的影响

  • 层的类型显着改变了性能。
  • 这些实验还验证了我们的框架适用于各种LLM和Transformer层,并强调选择适当的Transformer层的重要性。
  • 尽管它们可能不是最佳的,但最后的LLM层始终改善了性能

3.7 只有足够大的LLM才有提升Visual Encoding的效果

4 信息过滤假设

作者认为:“如果把加了LLM的提升都归结于"LLM包含了可以泛化的知识",其实比较偷懒而且不一定正确”

  • 预训练的LLM Transformer 作为“过滤器”发挥作用
    • 区分信息标记并放大它们对预测的贡献
    • 放大激活特征的幅度或频率的形式
    • LLM Transformer模块能够在训练的过程中筛选和目标任务相关的Visual Tokens并且放大他们的贡献。】

4.1 定性推导

4.1.1 有意义信息标记的显著集中 

  • 假设源于在增加预训练LLM Transformer后特征激活高亮展示了有意义的信息标记
    • 提取每个层后的特征激活信息
    • 特征激活是根据幅度(中心化后的L2范数)和频率(傅里叶变换后的角度的L2范数)计算的
  • ——>在添加LLM transformer后,标记激活更好地捕捉到目标对象的区域

4.1.2 嘈杂的注意力分数

  • 与特征激活相比,注意力分数很难捕捉到预测所需的相关视觉标记
    • 调查了CLS标记(classification)和最后一个transformer块中视觉标记之间的注意力分数
    • 有监督的 ViT 模型通常具有嘈杂的注意力分数
    • 尽管 ViT-LLaMA 展示了一些注意力头中偶尔有分割能力,但大多数注意力分数也受到散射和嘈杂的影响
  • ——>LLM transformer 的好处不能简单地归因于注意力分数,因为注意力分数无法可靠地贡献正确的视觉标记

4.2 定量证据

参考内容:[ICLR 2024 (Spotlight)] LLM里的Transformer还可以这么用? - 知乎 【作者自己的sharing】

阅读全文
AI总结
GitHub 加速计划 / tra / transformers
73
5
下载
huggingface/transformers: 是一个基于 Python 的自然语言处理库,它使用了 PostgreSQL 数据库存储数据。适合用于自然语言处理任务的开发和实现,特别是对于需要使用 Python 和 PostgreSQL 数据库的场景。特点是自然语言处理库、Python、PostgreSQL 数据库。
最近提交(Master分支:7 个月前 )
d1b92369 - 19 小时前
25b7f272 * remove one of the last deps * update fast image processor after refactor * styling * more quality of life improvements * nit * update * cleanups * some cleanups * vllm updates * update fake image token * [convert] Fix typo * [convert] Strip extraneous bytes from shards * [convert] Minor fixes * [convert] Use num_experts * multi-image fixes in modeling + processor * fixup size * 128 experts * Use default rope * Unfuse mlp * simplify a lot inputs embeds merging * remove .item() :eyes: * fix from review * Address feedback * Use None "default" for rope_scaling. Add eot. * set seed * return aspect ratios and bug fixes * Moe 128 rebased (#8) * 128 experts * Use default rope * Unfuse mlp * Address feedback * Use None "default" for rope_scaling. Add eot. * Meta/llama quant compat (#7) * add quant compatible model & conversion code for llama4 * fix a few issues * fix a few issues * minor type mapping fix --------- Co-authored-by: Lu Fang <fanglu@fb.com> * use a new config parameter to determine which model definition to use for MoE --------- Co-authored-by: Pedro Cuenca <pedro@huggingface.co> Co-authored-by: Lu Fang <fanglu@fb.com> * un-comment write_tokenizer from converting script * remove un-used imports * [llama4] Pop aspect_ratios from image processor output in Llama4Processor Signed-off-by: Jon Swenson <jmswen@gmail.com> * Fix parameter_count name * Update src/transformers/models/llama4/configuration_llama4.py * nit * Add changes for no_rope, moe_layers, chunked attention. Just need to test all * Update src/transformers/models/llama4/image_processing_llama4_fast.py * nit * fix post merge with main * support flex attention * fixes * fix * add layer * small updates * rebase and delete llm_compressor * nit * [llama4/mm] Add back <|image|> token that delimits global tile * [llama4/mm] Fix Llama 4 image processing unit tests * add explicit dtype Signed-off-by: Jon Swenson <jmswen@gmail.com> * sdpa works * comment todo small * fix model loading Signed-off-by: Zijing Liu <liuzijing2014@gmail.com> * revert * nits * small fix for TP on 1 node * Read new params from config * Add <|eom|> * lol don't know how this got here * adding fp8 * Save processor, fix chat template * style * Add boi/eoi tokens We don't use them. * fixes for now flex seems to work :) * updates * nits * updates * missking keys * add context parallel * update * update * fix * nits * add worldsize and make eager attn work for vision * Ignore new key present in base models * add tp_plan * fix nope Signed-off-by: Zijing Liu <liuzijing2014@gmail.com> * minor fix Signed-off-by: Zijing Liu <liuzijing2014@gmail.com> * Clean up Llama4 vision model * current updates * add support for `attn_temperature_tuning` * add floor scale * add missing attn scales * push what works, dirty trick for the device synch * oups * Fix pad_token_id See https://huggingface.co/ll-re/Llama-4-Scout-17B-16E/discussions/2/files Confirmed in the original codebase. * fix causallml loading * rm * fix tied-weights * fix sdpa * push current version * should work with both short and long * add compressed_tensos & fix fbgemm tp * Fix flex impl * style * chunking * try to revert the potentially breaking change * fix auto factory * fix shapes in general * rm processing * commit cache utils cleanup * Fix context length * fix * allocate * update tp_plan * fix SDPA! * Add support for sparse `Llama4TextMoe` layer from the kernel hub * cleanup * better merge * update * still broken fixing now * nits * revert print * Write max_position_embeddings and max_model_length * Update modeling_llama4.py * Save attention_chunk_size * Sync eos terminators * Read initializer_range * style * remove `dict` * fix * eager should use `chunked_attention_mask` * revert * fixup * fix config * Revert "Merge pull request #36 from huggingface/sparse-llama4-moe" This reverts commit ccda19f050867dd42ea143c5de60f3dec81375f0, reversing changes made to a515579aed8c0fe9bf529b6c40446a289406d5d6. * Fix typo and remove warning with compiled flex and chunked prefill * Fix MoE vs FF (#41) * fix * Use correct no_rope_layers if provided one is empty list * update tests * fix * skipping some tests * fix fp8 loading Signed-off-by: Zijing Liu <liuzijing2014@gmail.com> * fix text geneartion pipeline Signed-off-by: Zijing Liu <liuzijing2014@gmail.com> * eager needs 4D mask * fix * Some cleanup * fix * update * fix * replace correctly module * patch * modulelist * update * update * clean up * Don't move to `cuda:0` in distributed mode * restrict to compressed tensors for now * rm print * Docs! * Fixes * Update docs/source/en/model_doc/llama4.md Co-authored-by: Pedro Cuenca <pedro@huggingface.co> * Fixes * cuda graph fix * revert some stuff * fixup * styling * Update src/transformers/models/llama4/modeling_llama4.py Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * fixup * commit licence, cleanup here and there and style * more styling changes * fix dummies * fix and clean docstrings * remove comment * remove warning * Only fast image processor is supported * nit * trigger CI * fix issue with flex encoder * fix dynamic cache * Code quality * Code quality * fix more tests for now * Code quality * Code quality * Nuke bunch of failing stuff * Code quality * Code quality * cleanup removal of slow image processor * ruff fix fast image processor * fix * fix styling * Docs * Repo consistency * Repo consistency * fix sliding window issue * separate llama cache * styling * Repo consistency * Repo consistency * push waht works * L4 Repo consistency * Docs * fix last last alst alst alst alstsaltlsltlaslt --------- Signed-off-by: Jon Swenson <jmswen@gmail.com> Signed-off-by: Zijing Liu <liuzijing2014@gmail.com> Co-authored-by: yonigozlan <yoni.gozlan10@gmail.com> Co-authored-by: Pedro Cuenca <pedro@huggingface.co> Co-authored-by: Pablo Montalvo <pablo.montalvo.leroux@gmail.com> Co-authored-by: Pablo Montalvo <39954772+molbap@users.noreply.github.com> Co-authored-by: Keyun Tong <tongkeyun@gmail.com> Co-authored-by: Zijing Liu <liuzijing2014@users.noreply.github.com> Co-authored-by: Lu Fang <fanglu@fb.com> Co-authored-by: Zijing Liu <liuzijing2014@gmail.com> Co-authored-by: Jon Swenson <jmswen@gmail.com> Co-authored-by: jmswen <jmswen@users.noreply.github.com> Co-authored-by: MekkCyber <mekk.cyber@gmail.com> Co-authored-by: Mohamed Mekkouri <93391238+MekkCyber@users.noreply.github.com> Co-authored-by: Mohit Sharma <mohit21sharma.ms@gmail.com> Co-authored-by: Yong Hoon Shin <yhshin@meta.com> Co-authored-by: Marc Sun <marc@huggingface.co> Co-authored-by: drisspg <drisspguessous@gmail.com> Co-authored-by: Cyril Vallez <cyril.vallez@gmail.com> Co-authored-by: Daniël de Kok <me@danieldk.eu> Co-authored-by: Lysandre <hi@lysand.re> Co-authored-by: Ye (Charlotte) Qi <ye.charlotte.qi@gmail.com> Co-authored-by: ydshieh <ydshieh@users.noreply.github.com> 19 小时前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐