0% found this document useful (0 votes)
3 views15 pages

LLM RTF Framework Notes

This document provides an introduction to Large Language Models (LLMs) and the RTF framework for effective prompt engineering. It covers the definitions, functionalities, and training processes of LLMs, specifically focusing on GPT models and their applications across various industries. Additionally, it emphasizes the importance of structured prompts in generating high-quality AI outputs.

Uploaded by

hetaabhatt
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views15 pages

LLM RTF Framework Notes

This document provides an introduction to Large Language Models (LLMs) and the RTF framework for effective prompt engineering. It covers the definitions, functionalities, and training processes of LLMs, specifically focusing on GPT models and their applications across various industries. Additionally, it emphasizes the importance of structured prompts in generating high-quality AI outputs.

Uploaded by

hetaabhatt
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Generative AI & Prompt Engineering | Module 1

Introduction to

Large Language Models


& the RTF Framework

How AI Language Models Work — and How to Talk to Them Better

What is an LLM? GPT & Foundation Models Transformer Architecture RTF Prompting R

Sumeru Digital Academy


2024 Edition | For Student
Prompt Engineering | AI Fundamentals
STUDY NOTES

1 WHAT IS AN LLM?

DEFINITION
A Large Language Model (LLM) is an AI system trained on massive amounts
of text data to understand, generate, and manipulate human language.
Think of it as a very sophisticated autocomplete on steroids!

What does an LLM actually do?

Task Example

Predict next word/token Given "The sky is ...", predicts "blue"

Answer questions "What is Python?" -> Gives explanation

Summarize text Condenses a 10-page report to 5 bullets

Write content Drafts emails, code, essays on demand

Translate language Converts English to Hindi instantly

Key insight:
• LLMs do NOT think or understand — they predict patterns from training data.
• They learn by reading billions of web pages, books, and articles.
• The "Large" in LLM refers to both the model size (billions of parameters) and data size.
• Real-life analogy: A student who has read every textbook ever written — can answer questions, but might
not "understand" like humans do.

2 WHAT IS GPT?

DEFINITION
GPT = Generative Pre-trained Transformer
It is a specific TYPE of LLM developed by OpenAI.
ChatGPT is a product built ON TOP of the GPT model family.

Breaking down the acronym:

Letter Stands For What it means

Generative It CREATES new content (text, code, answers)


G

Introduction to LLMs & RTF Framework Page 1 Sumeru Digital Academy


STUDY NOTES

Pre-trained Trained on huge data BEFORE you use it


P
Transformer The neural network architecture it uses
T
GPT Versions Timeline:

Version Year Scale Notable For

GPT-1 2018 117M params Proof of concept

GPT-2 2019 1.5B params Surprisingly good writing

GPT-3 2020 175B params Shocked the world with quality

GPT-4 2023 ~1T+ params Multimodal, near-human reasoning

Introduction to LLMs & RTF Framework Page 2 Sumeru Digital Academy


STUDY NOTES

3 FOUNDATION MODELS

DEFINITION
Foundation Models are large, general-purpose AI models trained on broad data.
They serve as a BASE from which many specialized AI apps can be built.
Think: One powerful engine -> Many different vehicles built on top.

Characteristics of Foundation Models:

• Pre-trained on internet-scale data (text, images, code)


• General-purpose — not designed for one task only
• Adaptable — can be fine-tuned for specific domains
• Emergent abilities — show skills not explicitly trained (math, reasoning)

Examples of Foundation Models:

Model Creator Specialty

GPT-4 OpenAI Text + Vision

Claude Anthropic Safe, reasoning-focused AI

Gemini Google DeepMind Multimodal (text, images, video)

LLaMA 3 Meta AI Open-source, research

DALL-E 3 OpenAI Text-to-Image generation

4 TRAINING DATA

Where does the training data come from?

Source Details

Web Pages CommonCrawl — billions of web pages scraped from the internet

Books BookCorpus, Project Gutenberg — millions of novels and texts

Code GitHub, StackOverflow — billions of lines of programming code

Academic Papers ArXiv, PubMed — millions of research papers

Wikipedia Structured factual knowledge in 300+ languages

Social Media Reddit, forums — conversational and opinion-style text

Introduction to LLMs & RTF Framework Page 3 Sumeru Digital Academy


STUDY NOTES

DATA QUALITY MATTERS!


Garbage In = Garbage Out. If the training data contains biases,
errors, or harmful content, the model will reflect those problems.
That is why data CLEANING and FILTERING is extremely important.

Data Processing Steps:

• Collection — Scraping text from the internet and books


• Deduplication — Removing repeated/duplicate content
• Filtering — Removing toxic, illegal, or low-quality content
• Tokenization — Breaking text into chunks called tokens (words/sub-words)
• Formatting — Structuring data for the model to read efficiently

Introduction to LLMs & RTF Framework Page 4 Sumeru Digital Academy


STUDY NOTES

5 SCALE OF LLMS

Scale is what makes LLMs "Large." There are three dimensions of scale:

Dimension GPT-3 GPT-4 (est.) What it means

~1 Trillion (GPT-4 Learnable weights in the model (like


Parameters 175B (GPT-3)
est.) neurons in a brain)

Training Tokens 300B tokens 10+ Trillion tokens Amount of text seen during training

Processing power used to train the


Compute (FLOPs) 3.14e23 2.15e25
model

SCALING LAW (Chinchilla Law)


More parameters + more data + more compute = smarter model.
But scaling is expensive: GPT-4 training cost was estimated at
$50-100 MILLION. This is why only big companies can train frontier models.

6 CORE COMPONENTS

Every LLM is built on three fundamental pillars:

01 DATA 02 ARCHITECTURE 03 TRAINING

• Massive text corpus • Transformer-based • Next token prediction


• Cleaned & tokenized • Self-attention layers • RLHF fine-tuning
• Billions of tokens • Feed-forward networks • Massive GPU clusters
• Quality filtering applied • Embedding layers • Weeks/months of compute

Introduction to LLMs & RTF Framework Page 5 Sumeru Digital Academy


STUDY NOTES

7 TRANSFORMER ARCHITECTURE

DEFINITION
The Transformer is the neural network architecture that powers all modern LLMs.
Introduced in the 2017 paper 'Attention Is All You Need' by Google Brain.
Key innovation: The SELF-ATTENTION mechanism.

How does a Transformer process text?

Text is broken into tokens. E.g., "ChatGPT is cool" ->


STEP 1 INPUT TOKENIZATION
["Chat","G","PT"," is"," cool"]

Each token is converted to a number vector (a list of numbers


STEP 2 EMBEDDINGS
representing meaning).

Model looks at ALL tokens together and learns which words


STEP 3 SELF-ATTENTION
relate to each other.

FEED-FORWARD Each token goes through neural network layers for deeper
STEP 4
LAYERS processing.

STEP 5 OUTPUT PREDICTION The final layer predicts which token is most likely to come next.

SELF-ATTENTION (The Secret Sauce!)


Example: 'The trophy did not fit in the suitcase because IT was too big.'
-> What does 'IT' refer to? The TROPHY or the SUITCASE?
-> Self-attention helps the model figure out that IT = TROPHY (it's bigger).
This is what makes Transformers so powerful at understanding context.

8 TRAINING PROCESS

LLM Training happens in 3 major phases:

PHASE 1 Pre-training

* Model reads TRILLIONS of tokens from the internet, books, code

* Learns by predicting the next word at every step

* Takes weeks on thousands of GPUs

Introduction to LLMs & RTF Framework Page 6 Sumeru Digital Academy


STUDY NOTES

* Result: Model understands language patterns broadly

PHASE 2 Supervised Fine-Tuning (SFT)

* Human trainers write ideal question-answer pairs

* Model learns to respond in a helpful, structured way

* Much smaller dataset (~10K to 100K examples)

* Result: Model learns to follow instructions

PHASE 3 RLHF (Reinforcement Learning from Human Feedback)

* Humans rank multiple model responses (best to worst)

* A 'reward model' is trained to predict human preferences

* The LLM is fine-tuned to maximize the reward score

* Result: Model becomes more aligned, safe, and helpful

Introduction to LLMs & RTF Framework Page 7 Sumeru Digital Academy


STUDY NOTES

9 FINE-TUNING

DEFINITION
Fine-tuning is the process of taking a pre-trained model and further
training it on a SPECIFIC, SMALLER dataset for a particular use case.
It is cheaper and faster than training from scratch.

Types of Fine-Tuning:

Type How it works

Full Fine-Tuning Updates ALL model weights. Most powerful but very expensive.

LoRA (Low-Rank Adaptation) Updates only a small set of adapter weights. Fast and cheap!

Prompt Tuning Adds a small set of trainable tokens. No weight updates needed.

Reinforcement Learning from Human Feedback. Used by


RLHF
ChatGPT.

Real-Life Example:

• Base Model: GPT-4 (trained on general internet data)


• Fine-tuned for: Medical diagnosis — trained on clinical notes and medical literature
• Result: Behaves like a medical expert, not a general chatbot
• Another example: A CA firm could fine-tune an LLM on GST circulars and TDS rules!

10 BUSINESS APPLICATIONS

LLMs are transforming every industry. Here are real-world applications:

Healthcare Finance & Accounting

• Summarizing patient records and clinical notes • Automating financial report generation
• Drug discovery — finding patterns in research papers • Fraud detection using pattern analysis
• Medical chatbots for symptom checking • CA/Tax advisory chatbots (like [Link]!)

Education Marketing & Content

• Personalized tutoring and doubt solving • Writing SEO blogs, ad copy, social media posts
• Automated assignment feedback • Personalizing email campaigns at scale
• Generating study material and quizzes • Product description generation for e-commerce

Introduction to LLMs & RTF Framework Page 8 Sumeru Digital Academy


STUDY NOTES

Software Development Legal

• Code generation (GitHub Copilot, Claude Code) • Contract analysis and clause extraction
• Automated bug detection and fixing • Legal research and case summarization
• Writing documentation and test cases • Drafting legal documents and notices

Introduction to LLMs & RTF Framework Page 9 Sumeru Digital Academy


STUDY NOTES

11 INTRODUCTION TO RTF FRAMEWORK

THE RTF FRAMEWORK


RTF = Role + Task + Format
A simple 3-part structure for writing clear, effective prompts to LLMs.
Developed as a practical prompting technique for professional use.

ROLE
R Who should the AI be?

* Define the expertise or persona the AI should adopt

* Example: 'Act as a senior Python developer'

* Example: 'You are a GST consultant with 10 years of experience'

* Example: 'Behave like a friendly English teacher for Class 8 students'

TASK
T What do you want the AI to do?

* Give a clear, specific action or goal

* Example: 'Write a 500-word Instagram caption'

* Example: 'Debug this Python function and explain the issue'

* Example: 'Explain recursion to a beginner in simple terms'

FORMAT
F How should the output look?

* Specify the structure, length, or style of response

* Example: 'Use bullet points, max 200 words'

* Example: 'Return a JSON object with keys: title, summary, tags'

* Example: 'Write in a formal tone, 3 paragraphs, no jargon'

Introduction to LLMs & RTF Framework Page 10 Sumeru Digital Academy


STUDY NOTES

12 WHY RTF MATTERS

The quality of an AI output depends almost entirely on the quality of the input prompt. Vague prompts produce
generic, unusable answers. Structured prompts produce targeted, actionable results.

Comparison 1: Writing an Email

BAD PROMPT (No RTF) GOOD PROMPT (With RTF)


Prompt: 'Write an email.' Role: Act as a professional business writer.
Task: Write a follow-up email to a client
Output: who missed a meeting yesterday.
Subject: Email Format: Formal tone, 3 short paragraphs,
Dear Sir/Madam, subject line included, under 150 words.
I am writing to you regarding...
[Generic filler that helps nobody] Output: Precise, professional, ready-to-send
Regards, [Name] email with correct tone and structure.

Comparison 2: Asking for Coding Help

BAD PROMPT (No RTF) GOOD PROMPT (With RTF)


Prompt: 'Help me with Python.' Role: Act as a senior Python developer.
Task: Explain why my for-loop returns
Output: an empty list. Code: [paste code here]
Python is a programming language... Format: Explain in 3 bullet points.
Here are some basic concepts: Then show the fixed code.
1. Variables
2. Loops Output: Precise bug diagnosis + working
3. Functions fixed code with clear explanation.
[Completely off-target response]

Why does this matter? The Impact Chain:

Prompt Quality Output Result Student/Professional Impact

Vague ("Help me") Generic, off-topic, too broad Wasted time, needs rework

Average ("Explain X") Decent but surface-level Needs manual editing

RTF-Structured Targeted, detailed, formatted Ready to use immediately!

Introduction to LLMs & RTF Framework Page 11 Sumeru Digital Academy


STUDY NOTES

13 PRACTICAL EXAMPLES OF RTF

EXAMPLE 1 Content Creation — Instagram Post

ROLE Act as a social media content creator specializing in tech startups.

Write an engaging Instagram post announcing the launch of our new AI-powered
TASK
budgeting app called 'SpendSmart'.

FORMAT Max 150 words. Use 3-4 relevant emojis. Include 5 hashtags. End with a call-to-action.

• Engaging hook line with emoji


• 3-4 sentences about the product benefit
EXPECTED
• Call-to-action (Download now, Link in bio)
OUTPUT
• 5 targeted, trending hashtags
• Optimized for Instagram's algorithm

EXAMPLE 2 Coding Help — Debug Python Code

ROLE Act as a senior Python developer with expertise in Django.

Review this Django view function and identify why the user is getting a 404 error when
TASK
accessing /profile/. Provide a corrected version.

Step 1: Diagnose the issue in 2 sentences. Step 2: Show corrected code block. Step 3:
FORMAT
One-line explanation of what changed.

• Clear 2-sentence diagnosis of the bug


EXPECTED • Working corrected code (ready to copy-paste)
OUTPUT • Simple explanation of the fix
• Structured — easy to follow and learn from

EXAMPLE 3 Assignment Writing — BSc IT Submission

Act as a BSc IT professor helping a student understand and write a well-structured


ROLE
assignment.

Write an assignment on 'Advantages and Disadvantages of Cloud Computing' for a BSc IT


TASK
second-year student.

800-1000 words. Use headings: Introduction, Advantages (5 points), Disadvantages (4


FORMAT
points), Conclusion. Academic tone. Include 2 real-world examples.

Introduction to LLMs & RTF Framework Page 12 Sumeru Digital Academy


STUDY NOTES

• Complete 800-word academic assignment


EXPECTED • Properly structured with required headings
OUTPUT • Includes real examples (AWS, Google Cloud)
• Ready to submit — academic tone, no fluff

Introduction to LLMs & RTF Framework Page 13 Sumeru Digital Academy


STUDY NOTES

14 KEY TAKEAWAYS

LLMs Predict, Not Think


LLMs don't understand like humans — they predict the next most likely word based on statistical
01
patterns learned from training data. They have no consciousness or intent.

Output Quality = Input Quality


Your prompt is the most important variable. A vague prompt gives a vague answer. A precise,
02
structured prompt gives a precise, useful answer. You control the output!

RTF is Your Superpower


Role + Task + Format is a simple but powerful framework to structure any AI request. It takes 30
03
extra seconds and saves 30 minutes of editing the output.

LLMs Are Tools, Not Magic


An LLM is like a very powerful calculator — it does exactly what you ask it to. Mastering
04
prompting is the new skill everyone needs in the AI era.

Context is Everything
The more relevant context you give (examples, constraints, background), the better the model
05
performs. Think of prompting as briefing a very smart assistant.

FINAL THOUGHT
The AI era is not about replacing human intelligence — it is about AMPLIFYING it.
Those who learn to communicate effectively with AI tools will have a massive
competitive advantage. RTF is your first step toward that skill.

Start small: Apply RTF to your next ChatGPT/Claude prompt and see the difference!

Introduction to LLMs & RTF Framework Page 14 Sumeru Digital Academy

You might also like