A One-Layer Decoder-Only Transformer is a Two-Layer RNN: With an Application to Certified Robustness

Yuhao Zhang, Aws Albarghouthi, Loris D'Antoni
5/27/2024
cs.CL

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

This paper reveals a key insight that a one-layer decoder-only Transformer is equivalent to a two-layer Recurrent Neural Network (RNN). Building on this insight, we propose ARC-Tran, a novel approach for verifying the robustness of decoder-only Transformers against arbitrary perturbation spaces. Compared to ARC-Tran, current robustness verification techniques are limited either to specific and length-preserving perturbations like word substitutions or to recursive models like LSTMs. ARC-Tran addresses these limitations by meticulously managing position encoding to prevent mismatches and by utilizing our key insight to achieve precise and scalable verification. Our evaluation shows that ARC-Tran (1) trains models more robust to arbitrary perturbation spaces than those produced by existing techniques and (2) shows high certification accuracy of the resulting models.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zhang2024onelayer,
  title  = {A One-Layer Decoder-Only Transformer is a Two-Layer RNN: With an Application to Certified Robustness},
  author = {Yuhao Zhang and Aws Albarghouthi and Loris D'Antoni},
  year   = {2024},
  eprint = {2405.17361},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2405.17361v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2405.17361.svg)](https://codeofpaper.com/paper/2405.17361)

Discussion