Attention Is All You Need - Part 6

1 6 71
calendar_todayschedule1 min read
— Originally published at dev.to

Hello, I'm Ganesh. I'm building git-lrc, an AI code reviewer that runs on every commit. It is free, unlimited, and source-available on Github. Star Us to help devs discover the project. Do give it a try and share your feedback for improving the product.

In previous article we discussed about why traditional RNN model didn't work for long sentences.

In this article we will discuss about, how single attention head works?

Why Single Attention Head is not enough?

In single attention head, context of word is maintained and relates word/ token to each other.

But this also comes with a limitation of contextual understanding.

For Example:

If the sentence had multiple meanings, single attention head will focus on one.

Example:

In 5 Coach long train, in first coach the man was sleeping in 2nd coach the man was standing in 3rd coach the man was playing and in 4th coach the man was eating food.

So, for contextual understanding of man in above example needed and that is where single attention head fails.

To Solve this, multi head attention is introduced.

Multi Attention Head

Multi Attention Head works parallelly and independently. So, it captures contextual understanding of word/ token.

What next?

Finaly we got some idea on what end all happening under this.

I just want to hold upcomming exploration.

Just by getting into surface level I learned many things. But detailing i couldn't learn.

I think by 2 weeks I will explore those field and share my learning.

Reference: https://proceedings.neurips.cc/paper_files/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf

git-lrc

Any feedback or contributors are welcome! It’s online, source-available, and ready for anyone to use.
⭐ Star it on GitHub: https://github.com/HexmosTech/git-lrc

🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.

More Posts

Attention-Free Score: How Domain Reports Show Which Pages Need Work

ApogeeWatcherverified - Sep 1

Attention Is All You Need - Part 5

Ganesh Kumar - Jun 1

Cisco's Amy Chang: A Model's "Passport" Doesn't Tell You Where It Actually Came From

Tom Smithverified - Aug 27

Attention Is All You Need - Part 4

Ganesh Kumar - Jun 3

Attention Is All You Need - Part 1

Ganesh Kumar - Apr 29
chevron_left
1.5k Points78 Badges
68Posts
6Comments
5Connections
Right now I'm focused on LiveReview, AI code review that gives teams control over AI-generated code without slowing them down.

Commenters (This Week)

7 comments
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!