LLM:reward-model-deberta-v3-large-v2模型结构

https://hf-mirror.com/OpenAssistant/reward-model-deberta-v3-large-v2是在做合成数据的质量打分时的奖励模型。

模型依托deberta-v3-large-v2编码模型,给定一个qa对,能够给出一个分数来衡量qa对的质量。没有公开训练细节,由于模型的输出层是一个线性层且没有激活函数,输出的 原始分数(logits) 可以是任何实数,范围从负无穷到正无穷。一般删掉小于0的样本。

模型结构如下:

复制代码
DebertaV2ForSequenceClassification(
  (deberta): DebertaV2Model(
    (embeddings): DebertaV2Embeddings(
      (word_embeddings): Embedding(128100, 1024, padding_idx=0)
      (LayerNorm): LayerNorm((1024,), eps=1e-07, elementwise_affine=True)
      (dropout): StableDropout()
    )
    (encoder): DebertaV2Encoder(
      (layer): ModuleList(
        (0-23): 24 x DebertaV2Layer(
          (attention): DebertaV2Attention(
            (self): DisentangledSelfAttention(
              (query_proj): Linear(in_features=1024, out_features=1024, bias=True)
              (key_proj): Linear(in_features=1024, out_features=1024, bias=True)
              (value_proj): Linear(in_features=1024, out_features=1024, bias=True)
              (pos_dropout): StableDropout()
              (dropout): StableDropout()
            )
            (output): DebertaV2SelfOutput(
              (dense): Linear(in_features=1024, out_features=1024, bias=True)
              (LayerNorm): LayerNorm((1024,), eps=1e-07, elementwise_affine=True)
              (dropout): StableDropout()
            )
          )
          (intermediate): DebertaV2Intermediate(
            (dense): Linear(in_features=1024, out_features=4096, bias=True)
            (intermediate_act_fn): GELUActivation()
          )
          (output): DebertaV2Output(
            (dense): Linear(in_features=4096, out_features=1024, bias=True)
            (LayerNorm): LayerNorm((1024,), eps=1e-07, elementwise_affine=True)
            (dropout): StableDropout()
          )
        )
      )
      (rel_embeddings): Embedding(512, 1024)
      (LayerNorm): LayerNorm((1024,), eps=1e-07, elementwise_affine=True)
    )
  )
  (pooler): ContextPooler(
    (dense): Linear(in_features=1024, out_features=1024, bias=True)
    (dropout): StableDropout()
  )
  (classifier): Linear(in_features=1024, out_features=1, bias=True)
  (dropout): StableDropout()
)

可以看到是用DebertaV2为嵌入层和编码层(24个),然后加了池化层和分类层。

DebertaV2Model:核心的预训练语言模型部分,包括嵌入层和编码器。Embeddings(嵌入层)。Encoder(编码器)

Pooler(池化层):用于提取句子的整体表示。

Classifier(分类器):用于最终的分类任务。

DeBERTa系列模型的优化点

相比于BERT,提出了解耦注意力、RTD、增强的掩码解码器、梯度解耦嵌入共享、多语言。

解耦注意力机制(Disentangled Attention)

DeBERTa引入了解耦注意力机制,将每个输入词的内容和位置分别用两个独立的向量表示。这样,在计算注意力权重时,可以分别考虑内容和相对位置,而不需要同时考虑内容和绝对位置。

增强的掩码解码器(Enhanced Mask Decoder)

在掩码语言建模(MLM)的解码层中添加了上下文词的绝对位置信息,从而改进了MLM的效果。

替换令牌检测(Replaced Token Detection, RTD)

DeBERTaV3采用了ELECTRA中的RTD任务来替代传统的MLM任务。RTD任务使用一个生成器来生成模糊的替换词,并使用一个判别器来区分原始词和替换词。

梯度解耦嵌入共享(Gradient-Disentangled Embedding Sharing, GDES)

多语言

使用CC100多语言数据集进行预训练

相关推荐
Godspeed Zhao7 分钟前
自动驾驶中的传感器技术34——Lidar(9)
人工智能·机器学习·自动驾驶
yueyuebaobaoxinx11 分钟前
《当 AI 学会 “思考”:大语言模型的逻辑能力进化与隐忧》
人工智能
PythonPioneer13 分钟前
颠覆性进化:OpenAI正式发布GPT-5,AI大模型进入“超级智能”时代
人工智能·gpt
唐天下文化20 分钟前
bit-Agent正式接入GPT-5,九科信息智能体能力再升级!
人工智能·gpt
山烛44 分钟前
矿物分类系统开发笔记(二):模型训练[删除空缺行]
人工智能·笔记·python·机器学习·分类·数据挖掘
音视频牛哥1 小时前
从H.264到AV1:音视频技术演进与模块化SDK架构全解析
人工智能·音视频·大牛直播sdk·rtsp h.265·h.264 h.265 av1·h.265和h.266·enhenced rtmp
AIbase20241 小时前
如何快速找到最适合的AI绘画工具?避免在200+工具中挑花眼?
人工智能
机器之心2 小时前
DeepSeek开源新基础模型,但不是V4,而是V3.1-Base
人工智能·openai
金融小师妹2 小时前
AI多因子模型解析:黄金涨势受阻与美联储9月降息政策预期重构
大数据·人工智能·算法
R-G-B2 小时前
【P38 6】OpenCV Python——图片的运算(算术运算、逻辑运算)加法add、subtract减法、乘法multiply、除法divide
人工智能·python·opencv·图片的运算·图片加法add·图片subtract减法·图片乘法multiply