https://github.com/azlinrusnan/transformers_and_generative_ai
https://github.com/azlinrusnan/transformers_and_generative_ai
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/azlinrusnan/transformers_and_generative_ai
- Owner: AzlinRusnan
- Created: 2025-04-11T00:07:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-11T01:22:50.000Z (over 1 year ago)
- Last Synced: 2026-07-19T07:39:22.544Z (11 days ago)
- Language: Jupyter Notebook
- Size: 1.31 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Transformers_and_Generative_AI
๐ค Understanding BERT and GPT in the Simplest Way
Both BERT and GPT are language models, which means theyโre like smart brains trained to understand and work with human language.
## ๐ง BERT โ Bidirectional Encoder Representations from Transformers
Think of BERT as a student who carefully reads a sentence from both directions โ left to right AND right to left โ to fully understand its meaning.
Example:
Sentence: "Ali ate rice at a delicious restaurant."
If you ask BERT: โWhat did Ali eat?โ
BERT looks at the entire sentence, not just from the start. It understands context from both sides, so its answers are more accurate.
BERT is great for:
- Understanding sentence meaning
- Question answering
- Extracting key info from text
- Filling in missing words
๐ข BERT = Strong understanding (two-way thinking)
## ๐ง GPT โ Generative Pre-trained Transformer
GPT is like a creative writer. Itโs really good at continuing sentences, writing stories, or even drafting emails.
Example:
You write: "I love eating nasi lemak because..."
GPT will continue:
"...it tastes amazing and reminds me of family breakfasts."
GPT reads only from left to right, but itโs very good at predicting and generating natural-sounding text.
GPT is great for:
- Writing content
- Sentence completion
- Chatbots
- Translation
๐ GPT = Great at writing and generating text (one-way thinking)
๐ **Summary of the Differences**
>
> | Feature | BERT | GPT |
> |-----------------|-----------------------------|-----------------------------|
> | Reading style | Both directions | Left to right only |
> | Main purpose | Understanding text | Generating text |
> | Example tasks | Question answering, filling blanks | Story writing, text completion |
> | Analogy | Focused reader | Creative writer |
### To summarise:
- BERT is like someone who reads carefully to understand.
- GPT is like someone who writes naturally to continue your thoughts.
ps: still learning, will continue on LLM and more!