1 Star 3 Fork 2

青松/大模型(LLMs)面试笔记

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
青松-fasterai 青松 更新 a63ab51 3个月前
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

大模型(LLMs)面试笔记

介绍:本项目是作者根据个人招聘和面试经验整理的【大模型高频面题及答案解析】。覆盖大模型模型结构、训练、推理、应用以及其他 NLP 知识等。

适合大模型初学者和正在准备面试的小伙伴。希望能帮助各位同学缩短面试准备时间,不错过金三银四涨薪窗口,迅速收获心仪的Offer 🎉🎉🎉

一、大模型进阶面

💯 大模型(LLMs)DeepSeek面

点击查看答案

💯 大模型(LLMs)模型压缩面

  • 一、动因篇
    • 💯 为什么需要对大模型进行压缩和加速?
  • 二、方法篇
    • 低秩分解
      • 💯 什么是低秩分解?
      • 💯 什么是奇异值分解(SVD)?
    • 权值共享
      • 💯 什么是权值共享?
      • 💯 权值共享为什么有效?
    • 模型量化
      • 💯 什么是模型量化?
      • 💯 均匀量化和非均匀量化有什么区别?
      • 💯 大模型训练后量化有什么优点?
      • 💯 什么是混合精度分解?
    • 知识蒸馏
      • 💯 什么是蒸馏?
      • 💯 什么是基于反馈的知识蒸馏?
      • 💯 什么是基于特征的知识蒸馏?
      • 💯 什么是蒸馏损失?
      • 💯 什么是学生损失?
      • 💯 模型蒸馏的损失函数是什么?
    • 剪枝
      • 💯 什么是剪枝?
      • 💯 描述一下剪枝的基本步骤?
      • 💯 结构化剪枝和非结构化剪枝有什么不同?

点击查看答案

💯 大模型(LLMs)分布式训练面

  • 一、动因篇
    • 分布式训练主要解决大模型训练中的哪些问题?
  • 二、数据并行
    • 数据并行主要为了解决什么问题?
    • PS架构是如何进行梯度同步和更新的?
    • Ring-AllReduce是如何进行梯度同步和更新的?
    • PS架构和Ring-AllReduce架构有何不同?
  • 三、模型并行和张量并行
    • 模型并行主要为了解决什么问题?
    • 什么是张量并行,如何使用集群计算超大矩阵?
    • 基础的流水线并行存在什么问题?
    • 讲一讲谷歌的GPipe算法?
    • 讲一讲微软的PipeDream算法?
  • 四、DeepSpeed ZeRO
    • 如何计算大模型占用的显存?
    • ZeRO主要为了解决什么问题?
    • ZeRO1、ZeRO2、ZeRO3分别做了哪些优化?
    • 用DeepSpeed进行训练时主要配置哪些参数?

点击查看答案

💯 大模型(LLMs)模型编辑面

  • 一、概念篇
    • 什么是模型编辑(Model Editing)?
    • 模型编辑(Model Editing)核心目标是什么?
    • 对比重新预训练和微调,模型编辑的优势和适用场景是什么?
    • 如何用模型编辑修正大语言模型中的知识错误?
  • 二、性质篇
    • 模型编辑的五大性质(准确性、泛化性、可迁移性、局部性、高效性)分别是什么?
    • 如何量化评估模型编辑的五大性质?
    • 若模型编辑后泛化性较差,可能的原因是什么?如何优化?
    • 模型编辑局部性如何避免“牵一发而动全身”的问题?
  • 三、方法篇
    • 外部拓展法
      • 知识缓存法(如SERAC)的工作原理是什么?
      • 知识缓存法中的门控单元和推理模块如何协作?
      • 附加参数法(如T-Patcher)如何在不改变原始模型架构的情况下实现编辑?
      • 知识缓存法和附加参数法的优缺点有何优缺点?
    • 内部修改法
      • ROME方法如何通过因果跟踪实验定位知识存储位置?
      • 阻断实验的作用是什么?
      • 元学习法(如MEND)如何实现“学习如何编辑”?
      • 元学习法的双层优化框架如何设计?
      • 定位编辑法(如KN、ROME)如何通过修改全连接前馈层参数实现精准编辑?
  • 四、对比篇
    • SERAC、T-Patcher、ROME在准确性、泛化性、局部性上的表现有何差异?
    • 为什么ROME的局部性表现优于T-Patcher?

点击查看答案

二、大模型微调面

💯 大模型(LLMs)有监督微调(SFT)面

  • 一、概念篇
    • 💯 从零训练一个大模型有哪几个核心步骤?
    • 💯 为什么要对LLM做有监督微调(SFT)?
    • 💯 如何将一个基础模型训练成一个行业模型?
  • 二、数据篇
    • 💯 如何准备SFT阶段的训练数据?
    • 💯 alpaca 格式是这么样的?
    • 💯 sharegpt 格式是什么样的?
    • 💯 alpaca 格式和sharegpt 格式分别适合什么微调场景?
    • 💯 如何自动生成指令构建SFT的训练数据?
    • 💯 Self-instruct 数据生成步骤?
  • 三、技巧篇
    • 💯 什么是灾难性遗忘?
    • 💯 LM做有监督微调(SFT)变傻了怎么办?
    • 💯 如何避免灾难性遗忘?
  • 四、对比篇
    • 💯 有监督微调(SFT)和人工偏好对齐(RLHF)有何区别?
    • 💯 有监督微调(SFT)适用于什么场景?
    • 💯 人工偏好对齐(RLHF)适用于什么场景?

点击查看答案

💯 大模型(LLMs)高效微调面

  • 一、概念篇
    • 💯 什么是微调?
    • 💯 全量微调与参数高效微调的区别是什么?
    • 💯 为什么需要对大模型进行高效微调?
    • 💯 对大模型高效微调有哪些常用方法?
  • 二、轻度微调
    • 💯 什么是轻度微调?
    • 💯 轻度微调有哪些常用方法?
    • 💯 什么是BitFit微调?
    • 💯 什么是分层微调?
    • 💯 分层微调如何设置学习率?
  • 三、适配器微调
    • 💯 什么是适配器微调?
    • 💯 适配器微调有哪些优势?
    • 💯 讲一讲IA3微调?
  • 四、提示学习(Prompting)
    • 概念篇
      • 💯 什么是提示学习(Prompting)?
      • 💯 提示学习(Prompting) 代表方法有哪些?
    • 前缀微调(Prefix-tuning)
      • 💯 什么是前缀微调(Prefix-tining)?
      • 💯 前缀微调(Prefix-tining)的优点是什么?
      • 💯 前缀微调(Prefix-tining)的缺点是什么?
    • 提示微调(Prompt-tuning)
      • 💯 什么是提示微调(Prompt-tuning)?
      • 💯 提示微调(Prompt-tuning)的核心思想?
      • 💯 提示微调(Prompt-tuning)的 优点是什么?
      • 💯 提示微调(Prompt-tuning)的 缺点是什么?
    • P-tuning
      • 💯 P-tuning 动机是什么?
      • 💯 P-tuning v2 解决了什么问题?
      • 💯 P-tuning v2 进行了哪些改进?
  • 五、指令微调
    • 💯 为什么需要 指令微调(Instruct-tuning)?
    • 💯 指令微调(Instruct-tuning)是什么?
    • 💯 指令微调(Instruct-tuning)的优点是什么?
    • 💯 指令微调(Instruct-tuning) 和 提示学习(Prompting)的区别是什么?
  • 六、LoRa微调
    • 💯 什么是LoRA微调?
    • 💯 为什么在参数高效微调中使用低秩矩阵分解?
    • 💯 详细说明LoRA的工作原理及其优势?
    • 💯 LoRA微调时有哪些可配置的参数?
    • 💯 在配置LoRA时,如何设置参数r和alpha?
    • 💯 LoRA存在低秩瓶颈问题,ReLoRA和AdaLoRA分别通过哪些方法改进?
    • 💯 动态秩分配(如AdaLoRA)如何根据层的重要性调整秩?正交性约束的作用是什么?
    • 💯 AdapterFusion如何实现多任务学习?
    • 💯 如何利用LoRAHub实现跨任务泛化?其组合阶段与适应阶段的具体流程是什么?

点击查看答案

💯 大模型(LLMs)提示学习面

  • 一、概念篇
    • 💯 什么是提示学习(Prompting)?
    • 💯 提示学习(Prompting) 代表方法有哪些?
  • 二、方法篇
    • 前缀微调(Prefix-tuning)
      • 💯 什么是前缀微调(Prefix-tining)?
      • 💯 前缀微调(Prefix-tining)的优点是什么?
      • 💯 前缀微调(Prefix-tining)的缺点是什么?
    • 提示微调(Prompt-tuning)
      • 💯 什么是提示微调(Prompt-tuning)?
      • 💯 提示微调(Prompt-tuning)的核心思想?
      • 💯 提示微调(Prompt-tuning)的 优点是什么?
      • 💯 提示微调(Prompt-tuning)的 缺点是什么?
    • P-tuning
      • 💯 P-tuning 动机是什么?
      • 💯 P-tuning v2 解决了什么问题?
      • 💯 P-tuning v2 进行了哪些改进?
  • 三、对比篇
    • 💯 提示微调(Prompt-tuning)与 Prefix-tuning 区别 是什么?
    • 💯 提示微调(Prompt-tuning)与 fine-tuning 区别 是什么?

点击查看答案

💯 大模型(LLMs)人类对齐训练(RLHF)面

  • 一、概念篇
    • 💯 从零训练一个大模型有哪几个核心步骤?
    • 💯 从零训练大模型的三大阶段(Pretrain/SFT/RLHF)分别解决什么问题?
    • 💯 什么是人类偏好对齐训练?
    • 💯 为什么需要做人类偏好对齐训练?
    • 💯 RLHF有哪几个核心流程?
    • 💯 RLHF与SFT的本质区别是什么?为什么不能只用SFT?
    • 💯 什么是人类偏好对齐中的"对齐税"(Alignment Tax)?如何缓解?
    • 💯 RLHF的三大核心模块(奖励模型训练、策略优化、偏好数据收集)如何协同工作?
    • 💯 为什么RLHF需要马尔可夫决策过程(MDP)建模?对话场景如何设计MDP五元组?
  • 二、方法篇
    • 强化学习和马尔可夫决策过程(MDP)
      • 💯 马尔可夫决策过程的五元组是分别指什么?
      • 💯 状态价值函数、优势价值函数、动作价值函数分别表示什么意思?
      • 💯 在强化学习中,基于值函数的和基于策略的的优化方法有何区别?
      • 💯 基于值函数的方法在处理连续动作空间问题时的优缺点分别是什么?
      • 💯 基于策略的方法在处理连续动作空间问题时的优缺点分别是什么?
    • PPO 算法
      • 什么是近端策略优化(PPO)?
      • RLHF中的PPO主要分哪些步骤?
      • 💯 PPO中的重要性采样(Importance Sampling)如何修正策略差异?
      • 💯 Actor-Critic架构在RLHF中的双网络设计原理?
      • 💯 KL散度在RLHF中的双重作用是什么?
      • PPO-Clip与PPO-Penalty的数学形式差异及适用场景?
    • DPO 算法
      • 💯 DPO如何通过隐式奖励建模规避强化学习阶段?
      • Bradley-Terry模型与DPO目标函数的关系推导
      • DPO vs PPO:训练效率与性能上限的对比分析
  • 三、实践篇
    • 💯 RLHF训练数据的格式是什么样的?
    • 💯 人类偏好数据收集的三大范式(人工标注/用户隐式反馈/AI生成对比)?
    • 💯 如何选择人类偏好对齐训练还是SFT?
    • 💯 如何选择人类偏好对齐训练算法?
    • 💯 如何理解人类偏好对齐训练中的Reward指标?
    • 💯 Reward Hack问题(奖励模型过拟合)的检测与缓解方案有哪些?

点击查看答案

💯 大模型(LLMs)提示工程面

  • 一、概念篇
    • 什么是Prompt工程?
    • 为什么需要Prompt工程?
  • 二、技巧篇
    • Prompt设计要素
      • 任务说明、上下文、问题和输出格式的作用是什么?
      • 如何优化Prompt以提高模型性能?
      • 如何规范编写Prompt?
    • 上下文学习(In-Context Learning)
      • 什么是上下文学习?
      • 上下文学习三种形式(零样本、单样本、少样本)的区别?
      • 如何选择有效的演示示例?
      • 影响上下文学习性能的因素有哪些?
      • 如何通过预训练数据分布和模型规模优化上下文学习效果?
      • 为什么提示中示例的顺序和数量会影响模型性能?
    • 思维链(Chain of Thought, CoT)
      • 思维链(CoT)的核心思想是什么?
      • 思维链(CoT)在解决哪些任务类型中效果显著?
      • 思维链(CoT)有哪几种常见的模式?
      • 按部就班(如 Zero-Shot CoT、Auto-CoT)、三思后行(如 ToT、GoT)、集思广益(如 Self-Consistency)三种 CoT 模式有何异同?
      • 如何在不同任务中选择和应用CoT?
      • CoT如何提升模型在复杂推理任务中的表现?
      • 为什么某些指令微调后的模型无需显式 CoT 提示?
  • 三、对比篇
    • Prompt工程与传统微调的区别是什么?

点击查看答案

三、大模型(LLMs)基础面

💯 大模型(LLMs)模型架构面

  • 一、概念篇
    • 💯 LLM架构对Transformer都有哪些优化?
  • 二、组件篇
    • 位置编码
      • 💯 什么是正弦(Sinusoidal)位置编码?
      • 💯 什么是旋转位置编码(RoPE)?
      • 💯 RoPE相对正弦位置编码有哪些优势?
    • 长度外推
      • 💯 正弦编码是否真的具备外推性?
      • 💯 RoPE如何进行外推?
      • 💯 如何进行位置线性内插(Position Interpolation)?
      • 💯 NTK-Aware Scaled RoPE 和位置线性内插的区别是什么?
      • 💯 NTK-Aware Scaled RoPE 为何要对高频做外推,而对低频做内插?
    • 注意力机制
      • 💯 LLM为何使用GQA代替MHA?
      • 💯 GQA如何平衡计算效率与模型性能?
      • 💯 GQA与MQA(Multi-Query Attention)有何区别?各自适用场景是什么?
      • 💯 GQA是否会影响模型对不同注意力模式的捕捉能力?如何缓解?
    • PreNorm和PostNorm
      • 💯 PreNorm和PostNorm有何不同?
      • 💯 为什么PreNorm通常能提升训练稳定性?
      • 💯 PostNorm在何种场景下可能优于PreNorm?
      • 💯 如何通过残差连接设计缓解PostNorm的优化问题?
    • RMSNorm和LayerNorm
      • 💯 为何使用 RMSNorm 代替 LayerNorm?
      • 💯 RMSNorm与LayerNorm在数学公式上的核心区别是什么?
      • 💯 RMSNorm可能带来哪些信息损失?如何补偿?
      • 💯 RMSNorm是否适用于所有模态任务?
    • 激活函数
      • 💯 LLM使用SwiGLU相对于ReLU有什么好处?
      • 💯 SwiGLU相比ReLU如何提升模型非线性表达能力?
      • 💯 为什么SwiGLU在预训练任务中表现更佳?
      • 💯 SwiGLU的参数量是否会显著增加?如何优化?

点击查看答案

💯 大模型(LLMs)注意力机制(Attention)面

  • 一、概念篇
    • 💯 什么是 Attention?
    • 💯 为什么要引入 Attention 机制?
    • 💯 如何计算 Attention?
  • 二、变体篇
    • 💯 Soft Attention 是什么?
    • 💯 Hard Attention 是什么?
    • 💯 Global Attention 是什么?
    • 💯 Local Attention 是什么?
    • 💯 Self-Attention 是什么?
    • 💯 多查询注意力(Multi-Query Attention)是什么?
    • 💯 分组查询注意力(Grouped Query Attention)是什么?
    • 💯 分页注意力(Paged Attention)是什么?
    • 💯 闪存注意力(Flash Attention)是什么?

点击查看答案

💯 大模型(LLMs)Transformer面

  • 一、模型结构篇
    • 💯 Transformer 整体结构是怎么样的?
    • 💯 Transformer 编码器有哪些子层?
    • 💯 Transformer 解码器有哪些子层?
  • 二、核心机制篇
    • 位置编码
      • 💯 Transformer的输入中为什么要添加位置编码?
      • 💯 什么是正弦(Sinusoidal)位置编码?
      • 💯 Transformer的位置编码是如何计算的?
      • 💯 Position encoding为什么选择相加而不是拼接呢?
    • 多头注意力
      • 💯 Self-Attention 是什么?
      • 💯 多头注意力相对于单头注意力有什么优势?
      • 💯 Transformer中自注意力模块的计算过程?
      • 💯 什么是缩放点积注意力,为什么要除以 $\sqrt{d_k}$ ?
    • 残差连接
      • 💯 Transformer为什么要使用残差连接?
      • 💯 使用残差连接有哪些好处?
    • 层归一化
      • 💯 为什么要做归一化?
      • 💯 Layer Normalization 是什么?
      • 💯 Layer Normalization 有什么用?
      • 💯 批归一化和层归一化的区别?
      • 💯 Layer Normalization 有哪几个可训练参数?
    • Mask 机制
      • 💯 解码器中为什么要使用Mask?
      • 💯 Transformer 中有几种 Mask?
      • 💯 Padding Mask 是如何实现的?
      • 💯 Sequence Mask 是如何实现的?
  • 三、问题优化篇
    • 💯 LLM为何使用GQA代替MHA?
    • 💯 LLM为何使用 PreNorm 代替 PostNorm?
    • 💯 LLM为何使用 RMSNorm 代替 LayerNorm?
    • 💯 LLM使用SwiGLU相对于ReLU有什么好处?

点击查看答案

四、NLP 任务实战面

💯 大模型(LLMs)文本分类面

  • 一、概念篇
    • 什么是文本分类?
  • 二、方法篇
    • 主题建模法
      • 什么是主题建模任务?
      • 主题建模有哪些常用方法?
      • TF-IDF 算法是做什么的?
      • TF-IDF 有什么优缺点?适合哪些文本分类任务?
    • 传统分类法
      • 讲一讲 FastText 的分类过程?
      • 讲一讲 TextCNN 文本分类的过程?
      • 如何基于基于预训练模型做文本分类?
    • 检索匹配法
      • 什么场景需要用检索的方式做文本分类?
      • 如何用检索的方式做文本分类?
      • 检索的方法 的 训练阶段 如何做?
      • 检索的方法 的 预测阶段 如何做?
      • 用检索的方式做文本分类有何优缺点?
    • 大模型方法
      • 如何用Prompt的方式做文本分类?
      • 如何使用多提示学习提升文本分类效果?
      • 使用LLM做文本分类任务为何需要做标签词映射(Verbalizer)?
  • 三、进阶篇
    • 文本分类任务中有哪些难点?
    • 如何解决样本不均衡的问题?
    • 如何冷启动文本分类项目?
    • 如果类别会变化如何设计文本分类架构?
    • 短文本如何进行分类?
    • 长文本如何进行分类?

点击查看答案

💯 大模型(LLMs)命名实体识别(NER)面

  • 一、概念篇
    • 什么是实体识别?
    • 实体识别有哪些常用的解码方式?
    • NER的常用评价指标(精确率、召回率、F1)有何局限性?
    • 预训练模型(如BERT,LLM)如何改变传统NER的范式?
  • 二、方法篇
    • 传统方法
      • 如何用序列标注方法做NER任务?
      • 什么是 CRF?
      • CRF为什么比Softmax更适合NER?
      • 如何使用指针标注方式做NER任务?
      • 如何使用多头标注方式做NER任务?
      • 如何使用片段排列方式做NER任务?
    • 大模型方法
      • 如何将NER建模为生成任务(例如使用T5、GPT)?
      • 大模型做NER任务的解码策略有何不同?
      • 如何设计模板提升NER任务少样本效果?
    • 对比篇
      • 序列标注方法有何优缺点?
      • 指针标注、多头标注和片段排列有何优缺点,分别适用于哪些场景?
      • 大模型方法和传统方法做NER任务分别有什么优缺点?
  • 三、标注篇
    • 实体识别的数据是如何进行标注的?
    • BIO、BIOES、IOB2标注方案的区别与优缺点?
  • 四、问题篇
    • 实体识别中有哪些难点?
    • 什么是实体嵌套?
    • 如何解决实体嵌套问题?
    • 如何解决超长实体识别问题?
    • NER实体span过长怎么办?
    • 如何解决 NER 标注数据噪声问题?
    • 如何解决 NER 标注数据不均衡问题?

点击查看答案

💯 大模型(LLMs)关系抽取面

  • 一、概念篇
    • 什么是关系抽取?
    • 常见关系抽取流程的步骤是怎样的?
  • 二、句子级关系抽取篇
    • 什么是模板匹配方法?
    • 模板匹配方法的优点是什么?
    • 模板匹配方法存在哪些局限性或缺点呢?
    • 什么是关系重叠问题?
    • 什么是复杂关系问题?
    • 什么是联合抽取?
    • 介绍下基于共享参数的联合抽取方法?
    • 介绍下基于联合解码的联合抽取方法?
    • 关系抽取的端到端方法和流水线方法各有什么优缺点?
  • 三、文档级关系抽取篇
    • 文档级关系抽取与单句关系抽取有何区别?
    • 在进行跨句子甚至跨段落的关系抽取时,会遇到哪些特有的挑战?
    • 文档级关系抽取的方法有哪些?
    • 文档级关系抽取常见数据集有哪些以及其评估方法?

点击查看答案

💯 大模型(LLMs)检索增强生成(RAG)面

  • 一、动因篇
    • 为什么要做RAG系统?
    • RAG和大模型微调的区别?
    • RAG和大模型微调分别适用于什么场景?
    • 讲一下RAG的总体流程?
  • 二、流程篇
    • Query 理解
      • 用户理解阶段一般会做哪些处理?有何作用?
      • 用户问题总是召回不准确,在用户理解阶段可以做哪些优化?
    • Index 构建
      • 问答对问答中,如何构建索引,提升对用户问题的泛化能力?
      • 文档问答中,如何构建索引,提升对用户问题的泛化能力?
      • 问题经常命中不到文本块,如何在索引阶段做优化?
    • Retrieval 召回
      • 多路检索如何实现?
      • 如何合并多路检索的结果,对它们做排序?
      • BM25检索器总是召回无关的知识,最可能的原因是什么?
      • 如何借助其他用户的使用情况,提升总体的检索性能?
    • Reranker 精排
      • 为何要对检索的结果做精排(重排)?
      • 如何构建重排序模型的微调数据?

点击查看答案

五、NLP 基础面

💯 大模型(LLMs)分词(Tokenizer)面

  • 💯 如何处理超出词表的单词(OVV)?
  • 💯 BPE 分词器是如何训练的?
  • 💯 WordPiece 分词器是如何训练的?
  • 💯 Unigram 分词器是如何训练的?

点击查看答案

💯 大模型(LLMs)词嵌入(Word2Vec)面

  • 一、动因篇
    • 💯 什么是词向量化技术?
    • 💯 如何让向量具有语义信息?
  • 二、基于统计的方法
    • 💯 如何基于计数的方法表示文本?
    • 💯 上下文中的窗口大小是什么意思?
    • 💯 如何统计语料的共现矩阵?
    • 💯 基于计数的表示方法存在哪些问题?
  • 三、基于推理的方法
    • 💯 Word2Vec的两种模型分别是什么?
    • 💯 Word2Vec 中 CBOW 指什么?
    • 💯 Word2Vec 中 Skip-gram 指什么?
    • 💯 CBOW 和 Skip-gram 哪个模型的词嵌入更好?
  • 四、问题优化篇
    • 💯 Word2Vec训练中存在什么问题?
    • 💯 Word2Vec如何优化从中间层到输出层的计算?
      • 用负采样优化中间层到输出层的计算
      • 负采样方法的关键思想
      • 负采样的采样方法
    • 💯 为什么说Word2vec的词向量是静态的?
    • 💯 Word2vec的词向量存在哪些问题?

点击查看答案

💯 大模型(LLMs)卷积神经网络(CNN)面

  • 一、动因篇
    • 💯 卷积,池化的意义
  • 二、模型篇
    • 💯 为什么卷积核设计尺寸都是奇数
    • 💯 卷积操作的特点
    • 💯 为什么需要 Padding ?
    • 💯 卷积中不同零填充的影响?
    • 💯 1 1 卷积的作用?
    • 💯 卷积核是否越大越好?
    • 💯 CNN 特点
    • 💯 为何较大的batch size 能够提高 CNN 的泛化能力?
    • 💯 如何减少卷积层参数量?
  • 三、对比篇
    • 💯 SAME 与 VALID 的区别
    • 💯 CNN 优缺点
    • 💯 你觉得 CNN 有什么不足?
    • 💯 CNN 与 RNN 的优劣

点击查看答案

💯 大模型(LLMs)循环神经网络(RNN)面

  • 一、RNN 概念篇
    • 💯 RNN的作用是什么?
  • 二、RNN 模型篇
    • 💯 RNN的输入输出分别是什么?
    • 💯 RNN是如何进行参数学习(反向传播)的?
    • 💯 Relu 能否作为RNN的激活函数
  • 三、RNN 优化篇
    • 💯 RNN不能很好学习长期依赖的原因是什么?
    • 💯 RNN 中为何会出现梯度消失,梯度爆炸问题?
    • 💯 为何 RNN 训练时 loss 波动很大
    • 💯 计算资源有限的情况下有没有什么优化方法?
    • 💯 推导一下 GRU
  • 四、RNN 对比篇
    • 💯 LSTM 相对 RNN 的主要改进有哪些?
    • 💯 LSTM 与 GRU 之间的关系
    • 💯 LSTM 与 GRU 区别

点击查看答案

💯 大模型(LLMs)长短期记忆网络(LSTM)面

  • 一、动因篇
    • 💯 RNN 梯度消失的原因?
    • 💯 LSTM 如何缓解 RNN 梯度消失的问题?
    • 💯 LSTM不会发生梯度消失的原因
  • 二、模型篇
    • 💯 LSTM 相对 RNN 的主要改进有哪些?
    • 💯 门机制的作用
    • 💯 LSTM的网络结构是什么样的?
    • 💯 LSTM中记忆单元的作用是什么?
    • 💯 LSTM中的tanh和sigmoid分别用在什么地方?
    • 💯 LSTM有几个门,分别起什么作用?
    • 💯 LSTM 单元是如何进行前向计算的?
    • 💯 LSTM的前向计算如何进行加速?
    • 💯 LSTM 单元是如何进行反向传播的?
  • 三、应用篇
    • 💯 LSTM在实际应用中的提升技巧有哪些?
    • 为何多层LSTM叠加可以提升模型效果?
    • 双向LSTM为何更有效?
    • LSTM中如何添加Dropout层?

点击查看答案

💯 大模型(LLMs)BERT 模型面

  • 一、动因概念篇
    1. Bert 是什么?
    2. 为什么说BERT是双向的编码语言模型?
    3. BERT 是如何区分一词多义的?
    4. BERT为什么如此有效?
    5. BERT存在哪些优缺点?
  • 二、BERT 架构篇
    1. BERT 是如何进行预训练的?
    2. BERT的输入包含哪几种嵌入?
    3. 什么是分段嵌入?
    4. BERT的三个Embedding直接相加会对语义有影响吗?
    5. 讲一下BERT的WordPiece分词器的原理?
    6. 为什么BERT在第一句前会加一个【CLS】标志?
    7. BERT-base 模型和 BERT-large 模型之间有什么区别?
    8. 使用BERT预训练模型为什么最多只能输入512个词?
    9. BERT模型输入长度超过512如何解决?
  • BERT 训练篇
    • Masked LM 任务
      1. BERT 为什么需要预训练任务 Masked LM ?
      2. 掩码语言模型是如何实现的?
      3. 为什么要采取Masked LM,而不直接应用Transformer Encoder?
      4. Bert 预训练任务 Masked LM 存在问题?
      5. 什么是 80-10-10 规则,它解决了什么问题?
      6. bert为什么并不总是用实际的 masked token替换被“masked”的词汇?
      7. 为什么BERT选择mask掉15%这个比例的词,可以是其他的比例吗?
    • Next Sentence Prediction 任务
      1. Bert 为什么需要预训练任务 Next Sentence Prediction ?
      2. 下句预测任务是如何实现的?
  • BERT 微调篇
    1. 对 Bert 做 fine-turning 有什么优势?
    2. Bert 如何针对不同类型的任务进行 fine-turning?
  • 对比篇
    1. BERT 嵌入与 Word2Vec 嵌入有何不同?
    2. elmo、GPT和bert在单双向语言模型处理上的不同之处?
    3. word2vec 为什么解决不了多义词问题?
    4. 为什么 elmo、GPT、Bert能够解决多义词问题?

点击查看答案

💯 大模型(LLMs)BERT 变体面

  • 一、BERT变体篇
    • 句序预测任务与下句预测任务有什么不同?
    • ALBERT 使用的参数缩减技术是什么?
    • 什么是跨层参数共享?
    • RoBERTa 与 BERT 有什么不同?
    • 在 ELECTRA 中,什么是替换标记检测任务?
    • 如何在 SpanBERT 中掩盖标记?
    • Transformer-XL怎么实现对长文本建模?
  • 二、问题优化篇
    • 针对BERT原生模型的缺点,后续的BERT系列模型是如何改进【生成任务】的?
    • 针对BERT原生模型的缺点,后续的BERT系列模型是如何引入【知识】的?
    • 针对BERT原生模型的缺点,后续的BERT系列模型是如何引入【多任务学习机制】的?
    • 针对BERT原生模型的缺点,后续的BERT系列模型是如何改进【mask策略】的?
    • 针对BERT原生模型的缺点,后续的BERT系列模型是如何进行【精细调参】的?

点击查看答案

💯 大模型(LLMs)BERT 实战面

  • 一、场景篇
    • BERT擅长处理哪些下游NLP任务?
    • BERT为什么不适用于自然语言生成任务(NLG)?
    • 如何使用预训练的 BERT 模型?
    • 在问答任务中,如何计算答案的起始索引?
    • 在问答任务中,如何计算答案的结束索引?
    • 如何将 BERT 应用于命名实体识别任务?
  • 二、微调篇
    • 什么是微调?
    • 什么是继续预训练?
    • 如何进行继续预训练?
  • 三、问题篇
    • 什么是 Bert 未登录词?
    • Bert 未登录词如何处理?
    • Bert 未登录词各种处理方法有哪些优缺点?
    • BERT在输入层如何引入额外特征?

点击查看答案

六、深度学习面

💯 大模型(LLMs)激活函数面

  • 一、动因篇
    • 💯 为什么需要激活函数
    • 💯 为什么激活函数需要非线性函数?
  • 二、方法篇
    • sigmoid
      • 💯 什么是 sigmoid 函数?
      • 💯 为什么选 sigmoid 函数 作为激活函数?
      • 💯 sigmoid 函数有什么缺点?
    • tanh
      • 💯 什么是 tanh 函数?
      • 💯 为什么选 tanh 函数作为激活函数?
      • 💯 tanh 函数作为激活函数有什么缺点?
    • relu
      • 💯 什么是 relu 函数?
      • 💯 为什么选 relu 函数作为激活函数?
      • 💯 relu 函数有什么缺点?
      • 💯 为什么tanh收敛速度比sigmoid快?

点击查看答案

💯 大模型(LLMs)优化器面

  • 一、动因篇
    • 💯 梯度下降法的思想是什么?
  • 二、方法篇
    • 💯 SGD是如何实现的?
    • 💯 SGD有什么缺点?
    • 💯 Momentum 是什么?
    • 💯 Adagrad 是什么?
    • 💯 RMSProp是什么?
    • 💯 Adam 是什么?
  • 三、对比篇
    • 💯 批量梯度下降(BGD)、随机梯度下降(SGD)与小批量随机梯度下降(Mini-Batch GD)的区别?

点击查看答案

💯 大模型(LLMs)正则化面

  • 一、动因篇
    • 💯 为什么要正则化?
    • 💯 权重衰减的目的?
  • 二、$Ln$ 正则化篇
    • 💯 什么是 L1 正则化?
    • 💯 什么是 L2 正则化?
    • 💯 L1 与 L2 的异同
    • 💯 为什么 L1 正则化 可以产生稀疏值,而 L2 不会?
    • 💯 为何只对权重进行正则惩罚,而不针对偏置?
    • 💯 为何 L1 和 L2 正则化可以防止过拟合?
  • 三、Dropout 篇
    • 💯 什么是Dropout?
    • 💯 为什么Dropout可以解决过拟合问题?
    • 💯 Dropout 在训练和测试阶段的区别是什么?
    • 💯 Dropout 的变体有哪些?
    • 💯 如何选择合适的 Dropout 率?
    • 💯 Dropout 和其他正则化方法(如 L1、L2 正则化)有何不同?

点击查看答案

💯 大模型(LLMs)归一化面

  • 一、动因篇
    • 💯 为什么要做归一化?
    • 💯 为什么归一化能提高求最优解速度?
  • 二、方法篇
    • 💯 主流的归一化有哪些方法?
    • Batch Normalization
      • 💯 Batch Normalization 是什么?
      • 💯 Batch Normalization 的有点有哪些?
      • 💯 BatchNorm 存在什么问题?
    • Layer Normalization
      • 💯 Layer Normalization 是什么?
      • 💯 Layer Normalization 有什么用?
  • 三、对比篇
    • 💯 批归一化和组归一化的比较?
    • 💯 批归一化和权重归一化的比较?
    • 💯 批归一化和层归一化的比较?

点击查看答案

💯 大模型(LLMs)参数初始化面

  • 一、概念篇
    • 💯 什么是内部协变量偏移?
    • 💯 神经网络参数初始化的目的?
    • 💯 为什么不能将所有神经网络参数初始化为0?
  • 二、方法篇
    • 💯 什么是Xavier初始化?
    • 💯 什么是He初始化?

点击查看答案

💯 大模型(LLMs)过拟合面

  • 💯 过拟合与欠拟合的区别是什么?
  • 💯 解决欠拟合的方法有哪些?
  • 💯 防止过拟合的方法主要有哪些?
  • 💯 什么是Dropout?
  • 💯 为什么Dropout可以解决过拟合问题?

点击查看答案

💯 大模型(LLMs)集成学习面

  • 一、概念篇
    • 集成学习的核心思想是什么?
    • 集成学习与传统单一模型相比有哪些本质区别?
    • 从偏差-方差分解的角度,解释集成学习为什么能提升模型性能?
    • 集成学习有效性需要满足哪些前提条件?
  • 二、Boosting 篇
    • 解释一下 Boosting 的迭代优化过程
    • Boosting 的基本思想是什么?
    • Boosting 如何通过残差拟合实现误差修正?
    • GBDT 是什么?
    • XGBoost 是什么?
    • GBDT与 XGBoost 的核心差异是什么?
    • 为什么XGBoost要引入二阶泰勒展开?对模型性能有何影响?
  • 三、Bagging 篇
    • 什么是 Bagging?
    • Bagging 的基本思想是什么?
    • Bagging的并行训练机制如何提升模型稳定性?
    • 随机森林 是什么?
    • 随机森林与孤立森林的本质区别是什么?
    • 对比Bagging与Dropout在神经网络中的异同?
  • 四、Stacking 篇
    • 什么是 Stacking ?
    • Stacking 的基本思路是什么?
    • Stacking中为什么要用K折预测生成元特征?
    • 如何避免Stacking中信息泄露问题?
  • 五、对比篇
    • 对比Boosting/Bagging/Stacking三大范式的核心差异(目标、训练方式、基学习器关系)?
    • 集成学习中基学习器的"稳定性"如何影响算法选择?
    • Boosting、Bagging 与 偏差、方差的关系?
    • 为什么Bagging常用高方差模型?

点击查看答案

💯 大模型(LLMs)评估指标面

  • 一、概念篇
    • 💯 混淆矩阵有何作用?
    • 💯 分类任务中有哪几个常规的指标?
  • 二、F1-Score 篇
    • 💯 什么是 F1-Score?
    • 💯 对于多分类问题来说, F1 的计算有哪些计算方式?
    • 💯 什么是 Macro F1?
    • 💯 什么是 Micro F1?
    • 💯 什么是 Weight F1?
  • 三、对比篇
    • 💯 Macro 和 Micro 有什么区别?
    • 💯 什么是马修斯相关系数(MCC)?
  • 四、曲线篇
    • 💯 ROC 曲线主要有什么作用?
    • 💯 什么是 AUC(Area under Curve)?
    • 💯 P-R 曲线有何作用?

点击查看答案

七、面经分享

八、大厂AI实践

8.1 阿里AI实践

8.2 百度AI实践

8.3 腾讯AI实践

8.4 美团AI实践

8.5 小米AI实践

8.6 其他AI实践

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

本项目是作者根据个人招聘和面试经验整理的【大模型高频面题及答案解析】。覆盖大模型模型结构、训练、推理、应用以及其他 NLP 知识等。 适合大模型初学者和正在准备面试的小伙伴。希望能帮助各位同学缩短面试准备时间,不错过金三银四涨薪窗口,迅速收获心仪的Offer 🎉🎉🎉 展开 收起
README
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/fasterai/nlp-interview-handbook.git
git@gitee.com:fasterai/nlp-interview-handbook.git
fasterai
nlp-interview-handbook
大模型(LLMs)面试笔记
master

搜索帮助