Interview Prep
Interview questions, roadmaps and practice sets
Tutorials
Free tutorials on 30+ topics
Blog
Career guides, skills and interview tips
Free PDFs
Notes, cheat sheets and question banks
Certificates
Free skill tests and course certificates
Tools & Whiteboard
Free tools you can use right in the browser
Practice Tests
Mock tests, MCQs and quick Q&A
Free LMS
Learn on the Uncodemy LMS
Choose the best training program according to your career.
Improve the performance of your business with our innovative Industrial Training Program.
Read More →
Our instructor-led training classes are designed to make you an expert.
Read More →
Real-life case studies are a great way to demonstrate your practical knowledge.
Read More →
Explore blogs, latest technologies and industry updates with practical examples.
Read More →Browse all available training programs and choose the right one for your career.
Read More →Know more about who we are and what we stand for.
Discover our mission to equip individuals with essential IT skills and industry expertise.
Read More →
Free tutorials, interview questions, tools and calculators to help you learn.
Explore →Learn, practice and plan your career — bilkul free.
Book a free video counselling session and pick the right course for you.
Read More →A large language model (LLM) is a neural network trained on huge amounts of text to predict the next piece of text. GPT (from OpenAI), Claude (from Anthropic) and Gemini (from Google) are three families of LLMs that power popular assistants and APIs.
This introduction explains how LLMs work in plain terms, with a small temperature example, then describes each family, the open-weight alternatives and the limits you need to know.
The model does not read letters or whole words. Text is split into tokens: common words are often one token, rarer words are split into pieces, and spaces and punctuation count too. In English, one token is roughly three-quarters of a word on average, though this varies by language and tokenizer. Prices and context limits for LLM APIs are counted in tokens.
Almost all modern LLMs use the transformer architecture from the 2017 paper "Attention Is All You Need". Its key mechanism, self-attention, lets each token look at every other token in the context to decide what matters. Given "The capital of India is", the model outputs a score (a logit) for every token in its vocabulary. See the transformer paper explained for the details.
The scores are turned into probabilities with the softmax function, and a token is sampled. The temperature setting controls how adventurous that choice is. Here is the calculation for three candidate tokens:
import math
logits = {"Delhi": 4.0, "Mumbai": 2.0, "Paris": 0.5}
def probs(logits, temperature=1.0):
exps = {w: math.exp(v / temperature) for w, v in logits.items()}
total = sum(exps.values())
return {w: round(e / total, 3) for w, e in exps.items()}
print(probs(logits, 1.0))
print(probs(logits, 2.0))
print(probs(logits, 0.5))
Output:
{'Delhi': 0.858, 'Mumbai': 0.116, 'Paris': 0.026}
{'Delhi': 0.649, 'Mumbai': 0.239, 'Paris': 0.113}
{'Delhi': 0.981, 'Mumbai': 0.018, 'Paris': 0.001}
A higher temperature (2.0) flattens the distribution, so less likely tokens are picked more often: better for brainstorming, worse for facts. A lower temperature (0.5) makes the top choice dominant: better for code and factual answers. The chosen token is added to the text and the whole process repeats, one token at a time, until the answer is complete.
Everything the model can "see" at once, including your prompt, any documents you attach and the conversation so far, must fit within its context window, measured in tokens. Modern models have windows ranging from tens of thousands to over a million tokens. The model does not remember past conversations unless the application stores them and sends them again.
| GPT | Claude | Gemini | |
|---|---|---|---|
| Developer | OpenAI | Anthropic | Google DeepMind |
| Main consumer app | ChatGPT | Claude | Gemini |
| Developer access | OpenAI API, Microsoft Azure | Claude API, Amazon Bedrock, Google Cloud Vertex AI | Gemini API, Google Cloud Vertex AI |
| Known for | The assistant that popularised LLMs in 2022; wide ecosystem of plug-ins, voice and image features | Safety research such as Constitutional AI; strong at long documents, writing and coding | Built to be multimodal from the start; very long context; integration with Google Search, Workspace and Android |
All three companies release new model versions several times a year, usually in tiers (a large, most capable model and smaller, faster, cheaper ones). Rankings on benchmarks change with almost every release, so compare current versions on your own tasks rather than relying on a fixed "best" list. For a version-by-version comparison, see GPT-4, Claude 3 and Gemini compared and Gemini 2.5 Pro explained.
Besides these hosted services, several organisations publish model weights you can download and run yourself: Meta's Llama, Alibaba's Qwen, DeepSeek, Mistral and Google's Gemma, among others. They are useful when data must stay on your own servers, when you want to fine-tune, or when you need to control costs. They require you to handle hosting, scaling and safety yourself. See emerging LLMs you should know.
Most real products combine an LLM with other components: retrieval-augmented generation (RAG) fetches relevant documents and puts them in the prompt so answers are grounded; tool use lets the model call APIs, run code or search; and agents chain many such steps to complete a task. These patterns are why understanding tokens, context windows and temperature matters even if you never train a model yourself. For the bigger picture, read how transformers changed generative AI.
Uncodemy's Artificial Intelligence course covers LLM fundamentals, prompting and building applications on LLM APIs.