LEA: Improving Sentence Similarity Robustness to Typos Using Lexical Attention Bias 论文阅读

这篇具有很好参考价值的文章主要介绍了LEA: Improving Sentence Similarity Robustness to Typos Using Lexical Attention Bias 论文阅读。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

LEA: Improving Sentence Similarity Robustness to Typos Using Lexical Attention Bias 论文阅读

KDD 2023 原文地址

Introduction

文本噪声,如笔误(Typos), 拼写错误(Misspelling)和缩写(abbreviations), 会影响基于 Transformer 的模型. 主要表现在两个方面:

  1. Transformer 的架构中不使用字符信息.
  2. 由噪声引起的词元分布偏移使得相同概念的词元更加难以关联.

先前解决噪声问题的工作主要依赖于数据增强策略, 主要通过在训练集中加入类似的 typos 和 misspelling 进行训练.
数据增强确实使得模型在损坏(噪声)样本上表现出出更高的鲁棒性.
虽然这种策略在一定程度上已被证明有效地缓解了词元分布偏移的问题, 但所有这些方法仍然受到在 词元化(tokenization)中字符信息会丢失的限制.

Approach

LEA: Improving Sentence Similarity Robustness to Typos Using Lexical Attention Bias 论文阅读

在自注意机制中加入词感知注意模块(Lexical-aware Attention module, LEA).
LEA 考虑了句子间的词的字符关系, 文中认为这是提高句子相似性任务的关键, 特别是在存在 typos 的情况下.

Self-attention

定义 self-attention 的输入为 \(X=\set{x_1, x_2, \dots, x_n}\), 输出为 \(Z=\set{z_1, z_2, \dots, z_n}\), 输出中的每个 token 的表示计算如下:

\[\begin{equation} z_i=\sum_{j=i}^na_{ij}\left(x_j\cdot W^V\right), \quad z_i\in \mathbb R^{d_h}. \end{equation} \]

其中的注意力权重 \(a_{ij}\) 计算如下:

\[\begin{equation} a_{ij}=\frac{\text{exp}(e_{ij})}{\sum_{k=1}^{n}\text{exp}(e_{ik})}, \end{equation} \]

其中

\[\begin{equation} e_{ij}=\frac{(x_iW^Q)(x_jW^K)}{\sqrt{d_h}}. \end{equation} \]

Lexical attention bias

对于语义文本相似性(textual similarity), 将两个句子拼接:

\[\begin{equation} X_c=X_l|X_r \end{equation} \]

主要做法是参考了相对位置嵌入(relative position embeddings)的做法, 对 self-attention 中的 \(e_{ij}\) 进行如下修改:

\[\begin{equation} \tilde e_{ij}=e_{ij}+\alpha l_{ij} W^L, \end{equation} \]

其中第二项就是词偏向(lexical bias). \(W^L\in \mathbb R^{d^L\times 1}\) 是可训练参数, \(l\in \mathbb R^{1\times d^L}\) 是成对词汇注意嵌入(pairwise lexical attention embedding), \(\alpha\) 是一个固定的比例因子, 它在训练开始时根据两个项的大小自动计算一次.

为了计算成对词汇注意嵌入(pairwise lexical attention embedding), 先计算句子对之间单词的相似度, 而句子内单词的相似度设定为0:

\[\begin{equation} s_{ij}= \left\{ \begin{aligned} &0 &&,\text{ if }x_i,x_j\in X_l\text{ or }x_i,x_j\in X_r\\ &\text{Sim}\big(w(x_i), w(x_j)\big) &&\text{, otherwise.} \end{aligned} \right. \end{equation} \]

其中 Sim 是一个度量, 用于表示两个单词之间的字符串相似度.

之后通过将将 \(s_{ij}\) 带入 Transformer 中的正余弦函数, 得到表示词相似度的 embedding:

\[\begin{equation} \begin{aligned} l_{ij}^{(s_{ij}, 2p)}&=&&\sin{\left(\frac{2\pi\cdot d_{ij}}{\beta^{2p/d_h}} \right)},\\ l_{ij}^{(s_{ij}, 2p+1)}&=&&\cos{\left(\frac{2\pi\cdot d_{ij}}{\beta^{2p/d_h}} \right)}, \end{aligned} \end{equation} \]

最终的词相似度嵌入 \(l_{ij}\) 是上了两个向量的拼接.

Implementation details

论文中相似度度量选取的是 Jaccard 系数.
只在架构的后半层添加了 lexical attention bias.

Experiment

Performance

LEA: Improving Sentence Similarity Robustness to Typos Using Lexical Attention Bias 论文阅读
LEA: Improving Sentence Similarity Robustness to Typos Using Lexical Attention Bias 论文阅读
LEA: Improving Sentence Similarity Robustness to Typos Using Lexical Attention Bias 论文阅读

Impact of the lexical similarity choice

分析了使用不同相似度度量在 Abt-Buy 这个数据集上, BERT-Medium 的表现.
相似度度量包括: Jaccard (Jac.), Smith-Waterman (Smith), Longest Common Subsequence (LCS), Levenshtein (Lev.) and Jaro–Winkler (Jaro)

LEA: Improving Sentence Similarity Robustness to Typos Using Lexical Attention Bias 论文阅读

Jaccard 相似度系数是顺序不可知的, 因此对字符交换更健壮.
Jaccard 在有错别字和没有错别字的单词对之间提供了更高的可分离性, 这在短文本中是有益的.
然而, 随着句子长度的增加, 被比较的单词具有相似字符但含义不同的概率增加, 这降低了交换不变性优势.

Jaccard 相似系数: 集合 A, B 的交集与并集的比值

LEA on different layers and sharing strategy

文中认为, LEA 提供的字符级相似性可以被视为一种高级交互信息.
因此, 它为深层 Transformer 层补充了高层次的特性.
文中并没有验证这一假设.

Impact of the noise strength

直观地说, 由于 LEA 利用的字符级相似性不是在训练过程中学习到的, 因此它们为模型提供的信息在某种程度上较少依赖于噪声的量.

LEA: Improving Sentence Similarity Robustness to Typos Using Lexical Attention Bias 论文阅读

图3(下)显示了随着 typos 数量的增加, LEA 的性能与普通数据增强模型之间的差距越来越大, 这表明 LEA 可以更好地泛化到不同的噪声强度.

Additional experiments

Larger model

1.BERT-Large

LEA: Improving Sentence Similarity Robustness to Typos Using Lexical Attention Bias 论文阅读
2.GPT-like models
LEA: Improving Sentence Similarity Robustness to Typos Using Lexical Attention Bias 论文阅读

Larger dataset

LEA: Improving Sentence Similarity Robustness to Typos Using Lexical Attention Bias 论文阅读

BERT-M + DA 在 WDC-Comp.XL 性能超过了 LEA, 但是标准差较大.文章来源地址https://www.toymoban.com/news/detail-550141.html

到了这里,关于LEA: Improving Sentence Similarity Robustness to Typos Using Lexical Attention Bias 论文阅读的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • DREAMFUSION TEXT-TO-3D USING 2D DIFFUSION 论文笔记

    Recent breakthroughs in text-to-image synthesis have been driven by diffusion models trained on billions of image-text pairs. Adapting this approach to 3D synthe- sis would require large-scale datasets of labeled 3D data and efficient architectures for denoising 3D data, neither of which currently exist. In this work, we circum- vent these limitations by usi

    2024年02月07日
    浏览(41)
  • LEARNING TO EXPLORE USING ACTIVE NEURAL SLAM 论文阅读

    题目 :LEARNING TO EXPLORE USING ACTIVE NEURAL SLAM 作者 :Devendra Singh Chaplot, Dhiraj Gandhi 项目地址 :https://devendrachaplot.github.io/projects/Neural-SLAM 代码地址 :https://github.com/devendrachaplot/Neural-SLAM 来源 :LCLR 时间 :2022 这项工作提出了一种模块化和分层的方法来学习探索 3D 环境的策略,称为

    2024年02月14日
    浏览(33)
  • How to Implement a cascader using Web Component

    To implement a cascader using Web Components, you can create a custom element that encapsulates the cascader functionality. Here’s an example: In the above example, we define a custom element called cascader using the customElements.define() method. Inside the Cascader class, we extend the HTMLElement class to create our custom element. In the constructor,

    2024年02月19日
    浏览(34)
  • Using Docker Compose to Scale Your Microservice Archite

    作者:禅与计算机程序设计艺术 在微服务架构兴起之后,容器技术迅速成为云计算中的重要力量,docker及其相关工具提供了一种轻量级虚拟化环境,能够将应用程序打包成独立、可移植的容器,并利用docker compose等工具实现容器编排和管理。容器技术主要用于部署微服务,通

    2024年02月07日
    浏览(31)
  • VNC Viewer 远程 Unable to connect to VNC Server using your chosen securitysetting. 问题解决

    VNC Viewer 远程 Ubuntu桌面时(VNC服务端为Vino)可能出现以下问题: Unable to connect to VNC Server using your chosen security setting. Either upgrade VNC Server to a more recent version from RealVNC, or select a weaker level of encryption. 之所以出现这种问题是因为,远程连接Ubuntu桌面,在gnome桌面环境下,默认有一

    2024年02月16日
    浏览(28)
  • chromedriverUnable to obtain driver for chrome using ,selenium找不到chromedriver

    1、下载chromedriver chromedriver下载网址:CNPM Binaries Mirror 老版本在:chromedriver/ 较新版本在:chrome-for-testing/  2、设置了环境变量还是找不到chromedriverUnable to obtain driver for chrome using  方法: 第一种:chromedriver.exe复制文件放入python安装目录的Scripts文件夹中 例如:C:Users***AppDat

    2024年04月28日
    浏览(27)
  • 3D 生成重建004-DreamFusion and SJC :TEXT-TO-3D USING 2D DIFFUSION

    3D 生成重建004-DreamFusion and SJC :TEXT-TO-3D USING 2D DIFFUSION 0 论文工作 对于生成任务,我们是需要有一个数据样本,让模型去学习数据分布 p ( x ) p(x) p ( x ) ,但是对于3d的生成来说,有两个挑战:1)一个完善的很大的3d数据数据集,对比2d的扩散模型是一个几亿的图像文本对上训

    2024年02月07日
    浏览(29)
  • 解决‘_AxesStack‘ object is not callable while using networkx to plot

    在使用 networkx 进行图数据可视化时报错如题 \\\'_AxesStack\\\' object is not callable while using networkx to plot 。其中matplotlib为3.6.2版本,networkx版本为2.7。 将netwokx升级为最新版本 或直接将 nx.draw 改为 nx.draw_networkx [1] ‘_AxesStack’ object is not callable while using networkx to plot. stackoverflow

    2024年02月15日
    浏览(30)
  • We recommend using a newer Android Gradle plugin to use compileSdk = 34

    问题: We recommend using a newer Android Gradle plugin to use compileSdk = 34 This Android Gradle plugin (8.0.2) was tested up to compileSdk = 33. You are strongly encouraged to update your project to use a newer Android Gradle plugin that has been tested with compileSdk = 34. If you are already using the latest version of the Android Gradle plugin, you

    2024年02月06日
    浏览(30)
  • python报错解决:Fatal error in launcher: Unable to create process using

    安装库的时候用pip突然报错 很奇怪为什么pip安装不了,想一想,好像是我昨晚把其中一个python版本的包的文件夹给删掉了,就报错找不到pip.exe ,但是这里我有了3.11版本的了,完全不影响使用,简单记录一下解决方法 查找pip.exe所在的位置 我这里有两个,上面的那个是删掉的

    2024年02月05日
    浏览(36)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包