Coder Social home page Coder Social logo

compositional-attention's Introduction

Compositional-Attention

This repository contains the implementation of the research paper titled "COMPOSITIONAL ATTENTION: DISENTANGLING SEARCH AND RETRIEVAL" by Mittal et al(https://arxiv.org/pdf/2110.09419.pdf).

The paper proposes a novel attention mechanism called 'Compositional Attention', that replaces standard Multi Head Attention block in transformers. The proposed mechanism disentangles search and retrieval and composes them in a dynamic, flexible and context-dependent manner through an additional soft competition stage between the query-key combination and value pairing. In the paper, authors showed that this method out performs standard multi-head attention on a variety of tasks including some out of distribution setting. The goal of this project is to apply this method for a character level language modelling task to explore the capabilities of novel 'Compositional Attention' mechanism. For a reference baseline, I utilize the implementation of the multi-head attention mechanism for character-level language modeling, which was originally provided by Andrej Karpathy for his Nano GPT tutorials. All the hyper parameters are kept same as Karpathy's implementation to make a fair comparision.

The proposed method shows significant drop in train loss(around 95 %) and validation loss(around 96%) compared to the vanilla multi head attention block.

Reference

compositional-attention's People

Contributors

jd8111997 avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.