@shaykec/bridge 0.4.25 → 0.4.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/journeys/ai-engineer.yaml +34 -0
- package/journeys/backend-developer.yaml +36 -0
- package/journeys/business-analyst.yaml +37 -0
- package/journeys/devops-engineer.yaml +37 -0
- package/journeys/engineering-manager.yaml +44 -0
- package/journeys/frontend-developer.yaml +41 -0
- package/journeys/fullstack-developer.yaml +49 -0
- package/journeys/mobile-developer.yaml +42 -0
- package/journeys/product-manager.yaml +35 -0
- package/journeys/qa-engineer.yaml +37 -0
- package/journeys/ux-designer.yaml +43 -0
- package/modules/README.md +52 -0
- package/modules/accessibility-fundamentals/content.md +126 -0
- package/modules/accessibility-fundamentals/exercises.md +88 -0
- package/modules/accessibility-fundamentals/module.yaml +43 -0
- package/modules/accessibility-fundamentals/quick-ref.md +71 -0
- package/modules/accessibility-fundamentals/quiz.md +100 -0
- package/modules/accessibility-fundamentals/resources.md +29 -0
- package/modules/accessibility-fundamentals/walkthrough.md +80 -0
- package/modules/adr-writing/content.md +121 -0
- package/modules/adr-writing/exercises.md +81 -0
- package/modules/adr-writing/module.yaml +41 -0
- package/modules/adr-writing/quick-ref.md +57 -0
- package/modules/adr-writing/quiz.md +73 -0
- package/modules/adr-writing/resources.md +29 -0
- package/modules/adr-writing/walkthrough.md +64 -0
- package/modules/ai-agents/content.md +120 -0
- package/modules/ai-agents/exercises.md +82 -0
- package/modules/ai-agents/module.yaml +42 -0
- package/modules/ai-agents/quick-ref.md +60 -0
- package/modules/ai-agents/quiz.md +103 -0
- package/modules/ai-agents/resources.md +30 -0
- package/modules/ai-agents/walkthrough.md +85 -0
- package/modules/ai-assisted-research/content.md +136 -0
- package/modules/ai-assisted-research/exercises.md +80 -0
- package/modules/ai-assisted-research/module.yaml +42 -0
- package/modules/ai-assisted-research/quick-ref.md +67 -0
- package/modules/ai-assisted-research/quiz.md +73 -0
- package/modules/ai-assisted-research/resources.md +33 -0
- package/modules/ai-assisted-research/walkthrough.md +85 -0
- package/modules/ai-pair-programming/content.md +105 -0
- package/modules/ai-pair-programming/exercises.md +98 -0
- package/modules/ai-pair-programming/module.yaml +39 -0
- package/modules/ai-pair-programming/quick-ref.md +58 -0
- package/modules/ai-pair-programming/quiz.md +73 -0
- package/modules/ai-pair-programming/resources.md +34 -0
- package/modules/ai-pair-programming/walkthrough.md +117 -0
- package/modules/ai-test-generation/content.md +125 -0
- package/modules/ai-test-generation/exercises.md +98 -0
- package/modules/ai-test-generation/module.yaml +39 -0
- package/modules/ai-test-generation/quick-ref.md +65 -0
- package/modules/ai-test-generation/quiz.md +74 -0
- package/modules/ai-test-generation/resources.md +41 -0
- package/modules/ai-test-generation/walkthrough.md +100 -0
- package/modules/api-design/content.md +189 -0
- package/modules/api-design/exercises.md +84 -0
- package/modules/api-design/game.yaml +113 -0
- package/modules/api-design/module.yaml +45 -0
- package/modules/api-design/quick-ref.md +73 -0
- package/modules/api-design/quiz.md +100 -0
- package/modules/api-design/resources.md +55 -0
- package/modules/api-design/walkthrough.md +88 -0
- package/modules/clean-code/content.md +136 -0
- package/modules/clean-code/exercises.md +137 -0
- package/modules/clean-code/game.yaml +172 -0
- package/modules/clean-code/module.yaml +44 -0
- package/modules/clean-code/quick-ref.md +44 -0
- package/modules/clean-code/quiz.md +105 -0
- package/modules/clean-code/resources.md +40 -0
- package/modules/clean-code/walkthrough.md +78 -0
- package/modules/clean-code/workshop.yaml +149 -0
- package/modules/code-review/content.md +130 -0
- package/modules/code-review/exercises.md +95 -0
- package/modules/code-review/game.yaml +83 -0
- package/modules/code-review/module.yaml +42 -0
- package/modules/code-review/quick-ref.md +77 -0
- package/modules/code-review/quiz.md +105 -0
- package/modules/code-review/resources.md +40 -0
- package/modules/code-review/walkthrough.md +106 -0
- package/modules/daily-workflow/content.md +81 -0
- package/modules/daily-workflow/exercises.md +50 -0
- package/modules/daily-workflow/module.yaml +33 -0
- package/modules/daily-workflow/quick-ref.md +37 -0
- package/modules/daily-workflow/quiz.md +65 -0
- package/modules/daily-workflow/resources.md +38 -0
- package/modules/daily-workflow/walkthrough.md +83 -0
- package/modules/debugging-systematically/content.md +139 -0
- package/modules/debugging-systematically/exercises.md +91 -0
- package/modules/debugging-systematically/module.yaml +46 -0
- package/modules/debugging-systematically/quick-ref.md +59 -0
- package/modules/debugging-systematically/quiz.md +105 -0
- package/modules/debugging-systematically/resources.md +42 -0
- package/modules/debugging-systematically/walkthrough.md +84 -0
- package/modules/debugging-systematically/workshop.yaml +127 -0
- package/modules/demo-test/content.md +68 -0
- package/modules/demo-test/exercises.md +28 -0
- package/modules/demo-test/game.yaml +171 -0
- package/modules/demo-test/module.yaml +41 -0
- package/modules/demo-test/quick-ref.md +54 -0
- package/modules/demo-test/quiz.md +74 -0
- package/modules/demo-test/resources.md +21 -0
- package/modules/demo-test/walkthrough.md +122 -0
- package/modules/demo-test/workshop.yaml +31 -0
- package/modules/design-critique/content.md +93 -0
- package/modules/design-critique/exercises.md +71 -0
- package/modules/design-critique/module.yaml +41 -0
- package/modules/design-critique/quick-ref.md +63 -0
- package/modules/design-critique/quiz.md +73 -0
- package/modules/design-critique/resources.md +27 -0
- package/modules/design-critique/walkthrough.md +68 -0
- package/modules/design-patterns/content.md +335 -0
- package/modules/design-patterns/exercises.md +82 -0
- package/modules/design-patterns/game.yaml +55 -0
- package/modules/design-patterns/module.yaml +45 -0
- package/modules/design-patterns/quick-ref.md +44 -0
- package/modules/design-patterns/quiz.md +101 -0
- package/modules/design-patterns/resources.md +40 -0
- package/modules/design-patterns/walkthrough.md +64 -0
- package/modules/exploratory-testing/content.md +133 -0
- package/modules/exploratory-testing/exercises.md +88 -0
- package/modules/exploratory-testing/module.yaml +41 -0
- package/modules/exploratory-testing/quick-ref.md +68 -0
- package/modules/exploratory-testing/quiz.md +75 -0
- package/modules/exploratory-testing/resources.md +39 -0
- package/modules/exploratory-testing/walkthrough.md +87 -0
- package/modules/git/content.md +128 -0
- package/modules/git/exercises.md +53 -0
- package/modules/git/game.yaml +190 -0
- package/modules/git/module.yaml +44 -0
- package/modules/git/quick-ref.md +67 -0
- package/modules/git/quiz.md +89 -0
- package/modules/git/resources.md +49 -0
- package/modules/git/walkthrough.md +92 -0
- package/modules/git/workshop.yaml +145 -0
- package/modules/hiring-interviews/content.md +130 -0
- package/modules/hiring-interviews/exercises.md +88 -0
- package/modules/hiring-interviews/module.yaml +41 -0
- package/modules/hiring-interviews/quick-ref.md +68 -0
- package/modules/hiring-interviews/quiz.md +73 -0
- package/modules/hiring-interviews/resources.md +36 -0
- package/modules/hiring-interviews/walkthrough.md +75 -0
- package/modules/hooks/content.md +97 -0
- package/modules/hooks/exercises.md +69 -0
- package/modules/hooks/module.yaml +39 -0
- package/modules/hooks/quick-ref.md +93 -0
- package/modules/hooks/quiz.md +81 -0
- package/modules/hooks/resources.md +34 -0
- package/modules/hooks/walkthrough.md +105 -0
- package/modules/hooks/workshop.yaml +64 -0
- package/modules/incident-response/content.md +124 -0
- package/modules/incident-response/exercises.md +82 -0
- package/modules/incident-response/game.yaml +132 -0
- package/modules/incident-response/module.yaml +45 -0
- package/modules/incident-response/quick-ref.md +53 -0
- package/modules/incident-response/quiz.md +103 -0
- package/modules/incident-response/resources.md +40 -0
- package/modules/incident-response/walkthrough.md +82 -0
- package/modules/llm-fundamentals/content.md +114 -0
- package/modules/llm-fundamentals/exercises.md +83 -0
- package/modules/llm-fundamentals/module.yaml +42 -0
- package/modules/llm-fundamentals/quick-ref.md +64 -0
- package/modules/llm-fundamentals/quiz.md +103 -0
- package/modules/llm-fundamentals/resources.md +30 -0
- package/modules/llm-fundamentals/walkthrough.md +91 -0
- package/modules/one-on-ones/content.md +133 -0
- package/modules/one-on-ones/exercises.md +81 -0
- package/modules/one-on-ones/module.yaml +44 -0
- package/modules/one-on-ones/quick-ref.md +67 -0
- package/modules/one-on-ones/quiz.md +73 -0
- package/modules/one-on-ones/resources.md +37 -0
- package/modules/one-on-ones/walkthrough.md +69 -0
- package/modules/package.json +9 -0
- package/modules/prioritization-frameworks/content.md +130 -0
- package/modules/prioritization-frameworks/exercises.md +93 -0
- package/modules/prioritization-frameworks/module.yaml +41 -0
- package/modules/prioritization-frameworks/quick-ref.md +77 -0
- package/modules/prioritization-frameworks/quiz.md +73 -0
- package/modules/prioritization-frameworks/resources.md +32 -0
- package/modules/prioritization-frameworks/walkthrough.md +69 -0
- package/modules/prompt-engineering/content.md +123 -0
- package/modules/prompt-engineering/exercises.md +82 -0
- package/modules/prompt-engineering/game.yaml +101 -0
- package/modules/prompt-engineering/module.yaml +45 -0
- package/modules/prompt-engineering/quick-ref.md +65 -0
- package/modules/prompt-engineering/quiz.md +105 -0
- package/modules/prompt-engineering/resources.md +36 -0
- package/modules/prompt-engineering/walkthrough.md +81 -0
- package/modules/rag-fundamentals/content.md +111 -0
- package/modules/rag-fundamentals/exercises.md +80 -0
- package/modules/rag-fundamentals/module.yaml +45 -0
- package/modules/rag-fundamentals/quick-ref.md +58 -0
- package/modules/rag-fundamentals/quiz.md +75 -0
- package/modules/rag-fundamentals/resources.md +34 -0
- package/modules/rag-fundamentals/walkthrough.md +75 -0
- package/modules/react-fundamentals/content.md +140 -0
- package/modules/react-fundamentals/exercises.md +81 -0
- package/modules/react-fundamentals/game.yaml +145 -0
- package/modules/react-fundamentals/module.yaml +45 -0
- package/modules/react-fundamentals/quick-ref.md +62 -0
- package/modules/react-fundamentals/quiz.md +106 -0
- package/modules/react-fundamentals/resources.md +42 -0
- package/modules/react-fundamentals/walkthrough.md +89 -0
- package/modules/react-fundamentals/workshop.yaml +112 -0
- package/modules/react-native-fundamentals/content.md +141 -0
- package/modules/react-native-fundamentals/exercises.md +79 -0
- package/modules/react-native-fundamentals/module.yaml +42 -0
- package/modules/react-native-fundamentals/quick-ref.md +60 -0
- package/modules/react-native-fundamentals/quiz.md +61 -0
- package/modules/react-native-fundamentals/resources.md +24 -0
- package/modules/react-native-fundamentals/walkthrough.md +84 -0
- package/modules/registry.yaml +1650 -0
- package/modules/risk-management/content.md +162 -0
- package/modules/risk-management/exercises.md +86 -0
- package/modules/risk-management/module.yaml +41 -0
- package/modules/risk-management/quick-ref.md +82 -0
- package/modules/risk-management/quiz.md +73 -0
- package/modules/risk-management/resources.md +40 -0
- package/modules/risk-management/walkthrough.md +67 -0
- package/modules/running-effective-standups/content.md +119 -0
- package/modules/running-effective-standups/exercises.md +79 -0
- package/modules/running-effective-standups/module.yaml +40 -0
- package/modules/running-effective-standups/quick-ref.md +61 -0
- package/modules/running-effective-standups/quiz.md +73 -0
- package/modules/running-effective-standups/resources.md +36 -0
- package/modules/running-effective-standups/walkthrough.md +76 -0
- package/modules/solid-principles/content.md +154 -0
- package/modules/solid-principles/exercises.md +107 -0
- package/modules/solid-principles/module.yaml +42 -0
- package/modules/solid-principles/quick-ref.md +50 -0
- package/modules/solid-principles/quiz.md +102 -0
- package/modules/solid-principles/resources.md +39 -0
- package/modules/solid-principles/walkthrough.md +84 -0
- package/modules/sprint-planning/content.md +142 -0
- package/modules/sprint-planning/exercises.md +79 -0
- package/modules/sprint-planning/game.yaml +84 -0
- package/modules/sprint-planning/module.yaml +44 -0
- package/modules/sprint-planning/quick-ref.md +76 -0
- package/modules/sprint-planning/quiz.md +102 -0
- package/modules/sprint-planning/resources.md +39 -0
- package/modules/sprint-planning/walkthrough.md +75 -0
- package/modules/sql-fundamentals/content.md +160 -0
- package/modules/sql-fundamentals/exercises.md +87 -0
- package/modules/sql-fundamentals/game.yaml +105 -0
- package/modules/sql-fundamentals/module.yaml +45 -0
- package/modules/sql-fundamentals/quick-ref.md +53 -0
- package/modules/sql-fundamentals/quiz.md +103 -0
- package/modules/sql-fundamentals/resources.md +42 -0
- package/modules/sql-fundamentals/walkthrough.md +92 -0
- package/modules/sql-fundamentals/workshop.yaml +109 -0
- package/modules/stakeholder-communication/content.md +186 -0
- package/modules/stakeholder-communication/exercises.md +87 -0
- package/modules/stakeholder-communication/module.yaml +38 -0
- package/modules/stakeholder-communication/quick-ref.md +89 -0
- package/modules/stakeholder-communication/quiz.md +73 -0
- package/modules/stakeholder-communication/resources.md +41 -0
- package/modules/stakeholder-communication/walkthrough.md +74 -0
- package/modules/system-design/content.md +149 -0
- package/modules/system-design/exercises.md +83 -0
- package/modules/system-design/game.yaml +95 -0
- package/modules/system-design/module.yaml +46 -0
- package/modules/system-design/quick-ref.md +59 -0
- package/modules/system-design/quiz.md +102 -0
- package/modules/system-design/resources.md +46 -0
- package/modules/system-design/walkthrough.md +90 -0
- package/modules/team-topologies/content.md +166 -0
- package/modules/team-topologies/exercises.md +85 -0
- package/modules/team-topologies/module.yaml +41 -0
- package/modules/team-topologies/quick-ref.md +61 -0
- package/modules/team-topologies/quiz.md +101 -0
- package/modules/team-topologies/resources.md +37 -0
- package/modules/team-topologies/walkthrough.md +76 -0
- package/modules/technical-debt/content.md +111 -0
- package/modules/technical-debt/exercises.md +92 -0
- package/modules/technical-debt/module.yaml +39 -0
- package/modules/technical-debt/quick-ref.md +60 -0
- package/modules/technical-debt/quiz.md +73 -0
- package/modules/technical-debt/resources.md +25 -0
- package/modules/technical-debt/walkthrough.md +94 -0
- package/modules/technical-mentoring/content.md +128 -0
- package/modules/technical-mentoring/exercises.md +84 -0
- package/modules/technical-mentoring/module.yaml +41 -0
- package/modules/technical-mentoring/quick-ref.md +74 -0
- package/modules/technical-mentoring/quiz.md +73 -0
- package/modules/technical-mentoring/resources.md +33 -0
- package/modules/technical-mentoring/walkthrough.md +65 -0
- package/modules/test-strategy/content.md +136 -0
- package/modules/test-strategy/exercises.md +84 -0
- package/modules/test-strategy/game.yaml +99 -0
- package/modules/test-strategy/module.yaml +45 -0
- package/modules/test-strategy/quick-ref.md +66 -0
- package/modules/test-strategy/quiz.md +99 -0
- package/modules/test-strategy/resources.md +60 -0
- package/modules/test-strategy/walkthrough.md +97 -0
- package/modules/test-strategy/workshop.yaml +96 -0
- package/modules/typescript-fundamentals/content.md +127 -0
- package/modules/typescript-fundamentals/exercises.md +79 -0
- package/modules/typescript-fundamentals/game.yaml +111 -0
- package/modules/typescript-fundamentals/module.yaml +45 -0
- package/modules/typescript-fundamentals/quick-ref.md +55 -0
- package/modules/typescript-fundamentals/quiz.md +104 -0
- package/modules/typescript-fundamentals/resources.md +42 -0
- package/modules/typescript-fundamentals/walkthrough.md +71 -0
- package/modules/typescript-fundamentals/workshop.yaml +146 -0
- package/modules/user-story-mapping/content.md +123 -0
- package/modules/user-story-mapping/exercises.md +87 -0
- package/modules/user-story-mapping/module.yaml +41 -0
- package/modules/user-story-mapping/quick-ref.md +64 -0
- package/modules/user-story-mapping/quiz.md +73 -0
- package/modules/user-story-mapping/resources.md +29 -0
- package/modules/user-story-mapping/walkthrough.md +86 -0
- package/modules/writing-prds/content.md +133 -0
- package/modules/writing-prds/exercises.md +93 -0
- package/modules/writing-prds/game.yaml +83 -0
- package/modules/writing-prds/module.yaml +44 -0
- package/modules/writing-prds/quick-ref.md +77 -0
- package/modules/writing-prds/quiz.md +103 -0
- package/modules/writing-prds/resources.md +30 -0
- package/modules/writing-prds/walkthrough.md +87 -0
- package/package.json +1 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# How LLMs Work — Tokens, Context Windows, and Model Behavior
|
|
2
|
+
|
|
3
|
+
<!-- hint:slides topic="How LLMs work: tokenization, transformer architecture, attention mechanism, context windows, temperature, and model behavior" slides="6" -->
|
|
4
|
+
|
|
5
|
+
## What Is an LLM?
|
|
6
|
+
|
|
7
|
+
A **Large Language Model (LLM)** is a statistical model trained on vast amounts of text. It learns patterns in language — grammar, facts, reasoning, style — and uses those patterns to predict the next token. It doesn't "know" things in the human sense; it completes patterns based on what it was trained on.
|
|
8
|
+
|
|
9
|
+
## Tokenization
|
|
10
|
+
|
|
11
|
+
Text is broken into **tokens** — subword units (words, parts of words, punctuation). Most models use **BPE (Byte Pair Encoding)** or similar: common words are single tokens; rare words split into smaller pieces.
|
|
12
|
+
|
|
13
|
+
- "Hello" → 1 token
|
|
14
|
+
- "Claude" → 1–2 tokens
|
|
15
|
+
- "unbelievable" → 2–3 tokens
|
|
16
|
+
|
|
17
|
+
Token count affects cost and context limits. Roughly: 1 token ≈ 4 characters in English, 1–2 in code.
|
|
18
|
+
|
|
19
|
+
## The Transformer Pipeline
|
|
20
|
+
|
|
21
|
+
```mermaid
|
|
22
|
+
flowchart LR
|
|
23
|
+
A[Input Text] --> B[Tokenize]
|
|
24
|
+
B --> C[Embed]
|
|
25
|
+
C --> D[Attention Layers]
|
|
26
|
+
D --> E[Generate Next Token]
|
|
27
|
+
E --> F[Detokenize]
|
|
28
|
+
F --> G[Output Text]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
| Stage | What Happens |
|
|
32
|
+
|-------|--------------|
|
|
33
|
+
| **Tokenize** | Split input into tokens |
|
|
34
|
+
| **Embed** | Map tokens to vectors (numerical representations) |
|
|
35
|
+
| **Attention** | Model weights which tokens matter for the next prediction |
|
|
36
|
+
| **Generate** | Predict next token (probabilistically) |
|
|
37
|
+
| **Detokenize** | Convert tokens back to text |
|
|
38
|
+
|
|
39
|
+
## Attention (Simplified)
|
|
40
|
+
|
|
41
|
+
The **attention mechanism** lets the model look at all previous tokens and decide which ones are most relevant for predicting the next. "The cat sat on the mat" — when predicting "mat", the model attends strongly to "the" and "sat".
|
|
42
|
+
|
|
43
|
+
## Context Windows
|
|
44
|
+
|
|
45
|
+
The **context window** is the maximum number of tokens the model can "see" at once — prompt + response. If your prompt + response exceeds it, older tokens are dropped or truncated.
|
|
46
|
+
|
|
47
|
+
- Small: 4K–8K tokens
|
|
48
|
+
- Medium: 32K–128K tokens
|
|
49
|
+
- Large: 200K+ tokens
|
|
50
|
+
|
|
51
|
+
What fits: depends on model. 100K tokens ≈ 75K words ≈ a short book.
|
|
52
|
+
|
|
53
|
+
## Next-Token Prediction
|
|
54
|
+
|
|
55
|
+
At each step, the model predicts the **next token** from the distribution of possibilities. It doesn't plan ahead; it generates one token at a time. The choice is sampled (with temperature) from the predicted probabilities.
|
|
56
|
+
|
|
57
|
+
## Temperature and Sampling
|
|
58
|
+
|
|
59
|
+
- **Temperature 0** — Always pick the highest-probability token (deterministic).
|
|
60
|
+
- **Temperature 0.5** — Slight randomness; mostly likely tokens.
|
|
61
|
+
- **Temperature 1.0** — Sample proportionally to probability.
|
|
62
|
+
- **Temperature 2.0** — More random; creative but less coherent.
|
|
63
|
+
|
|
64
|
+
## Training vs Inference
|
|
65
|
+
|
|
66
|
+
| Phase | Purpose |
|
|
67
|
+
|-------|---------|
|
|
68
|
+
| **Training** | Learn patterns from data; update weights; expensive, one-time (per model) |
|
|
69
|
+
| **Inference** | Generate output; weights fixed; cost per token |
|
|
70
|
+
|
|
71
|
+
## Fine-Tuning vs Prompting
|
|
72
|
+
|
|
73
|
+
- **Prompting** — No model changes. You steer with instructions and examples. Fast, flexible.
|
|
74
|
+
- **Fine-tuning** — Retrain on labeled data. Better for domain-specific behavior, but requires data and compute.
|
|
75
|
+
|
|
76
|
+
## Why LLMs Hallucinate
|
|
77
|
+
|
|
78
|
+
LLMs complete patterns — they don't verify facts. Hallucination occurs when:
|
|
79
|
+
|
|
80
|
+
- The model confidently continues a plausible pattern that isn't true
|
|
81
|
+
- Training data had errors or conflicting information
|
|
82
|
+
- The prompt invites fabrication (e.g., "What did person X say in 2024?" when X said nothing)
|
|
83
|
+
- Temperature is high, increasing randomness
|
|
84
|
+
|
|
85
|
+
Mitigation: grounding (RAG), verification, lower temperature for factual tasks.
|
|
86
|
+
|
|
87
|
+
## Emergent Abilities and Scaling Laws
|
|
88
|
+
|
|
89
|
+
Larger models show **emergent abilities** — capabilities that appear suddenly at scale (e.g., few-shot learning, chain-of-thought). **Scaling laws** describe how performance improves with more data, parameters, and compute.
|
|
90
|
+
|
|
91
|
+
## Model Families
|
|
92
|
+
|
|
93
|
+
| Family | Examples | Notes |
|
|
94
|
+
|--------|----------|-------|
|
|
95
|
+
| GPT | GPT-4, GPT-4o | OpenAI; strong generalist |
|
|
96
|
+
| Claude | Claude 3, Claude 3.5 | Anthropic; long context, safety |
|
|
97
|
+
| Llama | Llama 3, Llama 3.1 | Meta; open weights |
|
|
98
|
+
| Gemini | Gemini Pro, Ultra | Google; multimodal |
|
|
99
|
+
|
|
100
|
+
## Safety and Alignment
|
|
101
|
+
|
|
102
|
+
**RLHF (Reinforcement Learning from Human Feedback)** — Train a reward model from human preferences, then optimize the policy toward that reward. Reduces harmful outputs and improves helpfulness.
|
|
103
|
+
|
|
104
|
+
**Alignment** — Making models behave according to human values: harmless, honest, helpful.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Key Takeaways
|
|
109
|
+
|
|
110
|
+
1. **Tokens** — Subword units; ~4 chars/token in English; drive cost and context limits
|
|
111
|
+
2. **Transformers** — Tokenize → Embed → Attention → Generate → Detokenize
|
|
112
|
+
3. **Context window** — Max tokens the model can use; older tokens dropped when exceeded
|
|
113
|
+
4. **Hallucination** — Confident pattern completion without knowledge; use RAG, verification
|
|
114
|
+
5. **Temperature** — Low = consistent; high = creative
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# LLM Fundamentals Exercises
|
|
2
|
+
|
|
3
|
+
## Exercise 1: Token Budget Planning
|
|
4
|
+
|
|
5
|
+
**Task:** You have a 4K context window. Your system prompt is 500 tokens. You want to include 3 few-shot examples (each ~150 tokens) and reserve 1K tokens for the response. How many tokens are left for the user's actual query? Express as a formula: `query_max = context - system - examples - response`.
|
|
6
|
+
|
|
7
|
+
**Validation:**
|
|
8
|
+
- [ ] Correct calculation: 4000 - 500 - 450 - 1000 = 2050 tokens
|
|
9
|
+
- [ ] Can explain why each component consumes context
|
|
10
|
+
|
|
11
|
+
**Hints:**
|
|
12
|
+
1. Sum all fixed parts: system + examples + response reserve
|
|
13
|
+
2. Remaining = context - fixed
|
|
14
|
+
3. User query must fit in remaining
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Exercise 2: Compare Tokenization Across Inputs
|
|
19
|
+
|
|
20
|
+
**Task:** Tokenize these with the same tool: (a) "The quick brown fox", (b) "def hello(): return 42", (c) "東京" (Tokyo in Japanese). Report tokens per character for each. Why do the ratios differ?
|
|
21
|
+
|
|
22
|
+
**Validation:**
|
|
23
|
+
- [ ] Reports token counts for all three
|
|
24
|
+
- [ ] Notes that code and non-Latin may use more tokens per character
|
|
25
|
+
- [ ] Can explain impact on cost/length for different input types
|
|
26
|
+
|
|
27
|
+
**Hints:**
|
|
28
|
+
1. Use OpenAI tokenizer or tiktoken
|
|
29
|
+
2. Compare tokens / characters
|
|
30
|
+
3. Code has many symbols; CJK often 1–2 chars per token
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Exercise 3: Design a Temperature Strategy
|
|
35
|
+
|
|
36
|
+
**Task:** For each use case, choose temperature (0, 0.3, 0.7, 1.0) and write one sentence justifying it:
|
|
37
|
+
1. Extracting JSON from a paragraph
|
|
38
|
+
2. Brainstorming blog title ideas
|
|
39
|
+
3. Answering "What is 2+2?"
|
|
40
|
+
4. Writing a product description in a specific brand voice
|
|
41
|
+
|
|
42
|
+
**Validation:**
|
|
43
|
+
- [ ] Extraction: 0 or 0.3 (deterministic)
|
|
44
|
+
- [ ] Brainstorm: 0.7–1.0 (creative)
|
|
45
|
+
- [ ] Math: 0 (deterministic)
|
|
46
|
+
- [ ] Brand voice: 0.3–0.5 (consistent but some variety)
|
|
47
|
+
|
|
48
|
+
**Hints:**
|
|
49
|
+
1. Factual/deterministic → low
|
|
50
|
+
2. Creative/varied → high
|
|
51
|
+
3. Brand voice: need consistency but not rigidity
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Exercise 4: Explain Hallucination in Your Own Words
|
|
56
|
+
|
|
57
|
+
**Task:** Write a 2–3 sentence explanation of why LLMs hallucinate, suitable for a non-technical colleague. Use the concepts: pattern completion, no verification, confidence. Avoid jargon like "logits" or "softmax".
|
|
58
|
+
|
|
59
|
+
**Validation:**
|
|
60
|
+
- [ ] Mentions that the model completes patterns
|
|
61
|
+
- [ ] Notes that it doesn't verify against knowledge
|
|
62
|
+
- [ ] Explains that confidence ≠ correctness
|
|
63
|
+
|
|
64
|
+
**Hints:**
|
|
65
|
+
1. "The model predicts what comes next, not what is true"
|
|
66
|
+
2. "It was trained on text patterns, not a fact database"
|
|
67
|
+
3. "It can sound confident even when wrong"
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Exercise 5: Trace the Pipeline for a Short Sentence
|
|
72
|
+
|
|
73
|
+
**Task:** For "The sky is", trace through: (1) How many tokens? (2) What might the model attend to when predicting the next token? (3) What are 3 plausible next tokens and why?
|
|
74
|
+
|
|
75
|
+
**Validation:**
|
|
76
|
+
- [ ] Correct token count (~4 tokens)
|
|
77
|
+
- [ ] Identifies "sky" and "is" as highly relevant for "blue" / "cloudy" / etc.
|
|
78
|
+
- [ ] Gives plausible completions with brief reasoning
|
|
79
|
+
|
|
80
|
+
**Hints:**
|
|
81
|
+
1. Tokenize first
|
|
82
|
+
2. "Sky" + "is" → color/weather adjectives
|
|
83
|
+
3. Plausible: blue, cloudy, gray, clear
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
slug: llm-fundamentals
|
|
2
|
+
title: "How LLMs Work — Tokens, Context Windows, and Model Behavior"
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: "Understand tokens, tokenization, transformers, context windows, and why LLMs behave the way they do."
|
|
5
|
+
category: ai-and-llm
|
|
6
|
+
tags: [llm, ai, tokens, context-window, transformer, machine-learning]
|
|
7
|
+
difficulty: intermediate
|
|
8
|
+
|
|
9
|
+
xp:
|
|
10
|
+
read: 15
|
|
11
|
+
walkthrough: 40
|
|
12
|
+
exercise: 25
|
|
13
|
+
quiz: 20
|
|
14
|
+
quiz-perfect-bonus: 10
|
|
15
|
+
|
|
16
|
+
time:
|
|
17
|
+
quick: 5
|
|
18
|
+
read: 25
|
|
19
|
+
guided: 50
|
|
20
|
+
|
|
21
|
+
prerequisites: [prompt-engineering]
|
|
22
|
+
related: [rag-fundamentals, ai-agents]
|
|
23
|
+
|
|
24
|
+
triggers:
|
|
25
|
+
- "How do LLMs work?"
|
|
26
|
+
- "What are tokens in AI?"
|
|
27
|
+
- "What is a context window?"
|
|
28
|
+
- "Why do LLMs hallucinate?"
|
|
29
|
+
|
|
30
|
+
visuals:
|
|
31
|
+
diagrams: [diagram-mermaid, diagram-architecture]
|
|
32
|
+
quiz-types: [quiz-matching, quiz-timed-choice]
|
|
33
|
+
playground: bash
|
|
34
|
+
slides: true
|
|
35
|
+
|
|
36
|
+
sources:
|
|
37
|
+
- url: "https://www.anthropic.com/research"
|
|
38
|
+
label: "Anthropic Research"
|
|
39
|
+
type: research
|
|
40
|
+
- url: "https://arxiv.org/abs/1706.03762"
|
|
41
|
+
label: "Attention Is All You Need"
|
|
42
|
+
type: paper
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# LLM Fundamentals Quick Reference
|
|
2
|
+
|
|
3
|
+
## Transformer Pipeline
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
Input → Tokenize → Embed → Attention → Generate → Detokenize → Output
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Token Basics
|
|
10
|
+
|
|
11
|
+
| Concept | Value |
|
|
12
|
+
|---------|-------|
|
|
13
|
+
| ~1 token | ~4 characters (English) |
|
|
14
|
+
| ~1 token | ~0.75 words |
|
|
15
|
+
| BPE | Byte Pair Encoding (common tokenization) |
|
|
16
|
+
|
|
17
|
+
## Context Window
|
|
18
|
+
|
|
19
|
+
- Max tokens (prompt + response) the model can process
|
|
20
|
+
- Exceeded → older tokens dropped
|
|
21
|
+
- Sizes: 4K–8K (small), 32K–128K (medium), 200K+ (large)
|
|
22
|
+
|
|
23
|
+
## Temperature
|
|
24
|
+
|
|
25
|
+
| Range | Effect |
|
|
26
|
+
|-------|--------|
|
|
27
|
+
| 0 | Deterministic (always most likely token) |
|
|
28
|
+
| 0.3–0.5 | Slight variation, factual tasks |
|
|
29
|
+
| 0.7–1.0 | Creative, varied output |
|
|
30
|
+
| >1 | Very random, often incoherent |
|
|
31
|
+
|
|
32
|
+
## Training vs Inference
|
|
33
|
+
|
|
34
|
+
| Phase | Purpose |
|
|
35
|
+
|-------|---------|
|
|
36
|
+
| Training | Learn from data; update weights |
|
|
37
|
+
| Inference | Generate; weights fixed; pay per token |
|
|
38
|
+
|
|
39
|
+
## Fine-Tuning vs Prompting
|
|
40
|
+
|
|
41
|
+
| Approach | When |
|
|
42
|
+
|----------|------|
|
|
43
|
+
| Prompting | Fast, flexible; no model change |
|
|
44
|
+
| Fine-tuning | Domain-specific; need labeled data |
|
|
45
|
+
|
|
46
|
+
## Why Hallucination?
|
|
47
|
+
|
|
48
|
+
- Model completes patterns; doesn't verify facts
|
|
49
|
+
- Confident ≠ correct
|
|
50
|
+
- Mitigate: RAG, verification, lower temperature
|
|
51
|
+
|
|
52
|
+
## Model Families
|
|
53
|
+
|
|
54
|
+
- **GPT** — OpenAI
|
|
55
|
+
- **Claude** — Anthropic
|
|
56
|
+
- **Llama** — Meta (open)
|
|
57
|
+
- **Gemini** — Google
|
|
58
|
+
|
|
59
|
+
## One-Liners
|
|
60
|
+
|
|
61
|
+
- **Tokens** — Subword units; drive cost and context limits.
|
|
62
|
+
- **Attention** — Model weights which tokens matter for next prediction.
|
|
63
|
+
- **Context window** — Max tokens; overflow = truncation.
|
|
64
|
+
- **Hallucination** — Confident pattern completion without knowledge.
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# LLM Fundamentals Quiz
|
|
2
|
+
|
|
3
|
+
## Question 1
|
|
4
|
+
|
|
5
|
+
What is a token?
|
|
6
|
+
|
|
7
|
+
A) A security credential for API access
|
|
8
|
+
B) A subword unit used to represent text — words or parts of words
|
|
9
|
+
C) A type of neural network layer
|
|
10
|
+
D) A unit of time in model training
|
|
11
|
+
|
|
12
|
+
<!-- ANSWER: B -->
|
|
13
|
+
<!-- EXPLANATION: Tokens are subword units (words, word pieces, punctuation) that the model uses to represent text. Tokenization splits input into tokens before processing. -->
|
|
14
|
+
|
|
15
|
+
## Question 2
|
|
16
|
+
|
|
17
|
+
What happens when your prompt plus response exceeds the context window?
|
|
18
|
+
|
|
19
|
+
A) The model automatically switches to a larger model
|
|
20
|
+
B) The model runs faster
|
|
21
|
+
C) Older tokens are dropped or truncated; the model can't use them
|
|
22
|
+
D) The model compresses the text to fit
|
|
23
|
+
|
|
24
|
+
<!-- ANSWER: C -->
|
|
25
|
+
<!-- EXPLANATION: When the context window is exceeded, earlier tokens are typically dropped or truncated. The model cannot attend to tokens outside its context limit. -->
|
|
26
|
+
|
|
27
|
+
## Question 3
|
|
28
|
+
|
|
29
|
+
Why do LLMs hallucinate?
|
|
30
|
+
|
|
31
|
+
A) They are programmed to make things up
|
|
32
|
+
B) They complete patterns confidently without verifying facts
|
|
33
|
+
C) They only hallucinate when temperature is 0
|
|
34
|
+
D) Hallucination is always due to training data errors
|
|
35
|
+
|
|
36
|
+
<!-- ANSWER: B -->
|
|
37
|
+
<!-- EXPLANATION: LLMs predict the next token based on patterns. They can confidently complete plausible-sounding text that isn't true because they don't have a mechanism to verify facts. -->
|
|
38
|
+
|
|
39
|
+
## Question 4
|
|
40
|
+
|
|
41
|
+
Match the transformer stage to its role:
|
|
42
|
+
|
|
43
|
+
<!-- VISUAL: quiz-matching -->
|
|
44
|
+
|
|
45
|
+
A) Tokenize — Split text into subword units
|
|
46
|
+
B) Embed — Map tokens to vectors
|
|
47
|
+
C) Attention — Weight which tokens matter for prediction
|
|
48
|
+
D) Generate — Predict next token
|
|
49
|
+
|
|
50
|
+
<!-- ANSWER: All match correctly -->
|
|
51
|
+
<!-- EXPLANATION: Tokenize splits input; Embed converts to vectors; Attention computes relevance; Generate produces the next token. -->
|
|
52
|
+
|
|
53
|
+
## Question 5
|
|
54
|
+
|
|
55
|
+
What does RLHF stand for and what is it used for?
|
|
56
|
+
|
|
57
|
+
A) Reinforcement Learning from Human Feedback — aligning model behavior with human preferences
|
|
58
|
+
B) Random Language Hyperparameter Finetuning — tuning model settings
|
|
59
|
+
C) Recursive Layer Hidden Framework — a type of architecture
|
|
60
|
+
D) Real-time Language Human Filter — content moderation
|
|
61
|
+
|
|
62
|
+
<!-- ANSWER: A -->
|
|
63
|
+
<!-- EXPLANATION: RLHF uses human feedback to train a reward model, then optimizes the policy toward that reward. It helps align model behavior with human values (helpful, harmless, honest). -->
|
|
64
|
+
|
|
65
|
+
## Question 6
|
|
66
|
+
|
|
67
|
+
What is the approximate token-to-character ratio for English text?
|
|
68
|
+
|
|
69
|
+
A) 1 token = 1 character
|
|
70
|
+
B) 1 token ≈ 4 characters
|
|
71
|
+
C) 1 token = 1 word
|
|
72
|
+
D) 1 token ≈ 10 characters
|
|
73
|
+
|
|
74
|
+
<!-- ANSWER: B -->
|
|
75
|
+
<!-- EXPLANATION: In English, roughly 1 token equals about 4 characters (or 0.75 tokens per word). This varies by language and content type. -->
|
|
76
|
+
|
|
77
|
+
## Question 7
|
|
78
|
+
|
|
79
|
+
<!-- VISUAL: quiz-matching -->
|
|
80
|
+
|
|
81
|
+
Match each LLM concept to its description:
|
|
82
|
+
|
|
83
|
+
A) Context window → 1) Maximum sequence length the model can process at once
|
|
84
|
+
B) Temperature → 2) Subword units used to represent text
|
|
85
|
+
C) Tokens → 3) Controls randomness; higher = more varied outputs
|
|
86
|
+
D) Hallucination → 4) Model generating plausible but false or irrelevant content
|
|
87
|
+
|
|
88
|
+
<!-- ANSWER: A1,B3,C2,D4 -->
|
|
89
|
+
<!-- EXPLANATION: Context window is the max sequence length. Temperature controls output randomness. Tokens are subword units. Hallucination is confident generation of false or irrelevant content. -->
|
|
90
|
+
|
|
91
|
+
## Question 8
|
|
92
|
+
|
|
93
|
+
<!-- VISUAL: quiz-matching -->
|
|
94
|
+
|
|
95
|
+
Match each model parameter to its typical effect:
|
|
96
|
+
|
|
97
|
+
A) Temperature = 0 → 1) More deterministic, focused output
|
|
98
|
+
B) Temperature = 1 → 2) More creative, varied output
|
|
99
|
+
C) Top-p (nucleus) low → 3) Fewer token choices; more focused
|
|
100
|
+
D) Top-p (nucleus) high → 4) Broader token sampling; more diversity
|
|
101
|
+
|
|
102
|
+
<!-- ANSWER: A1,B2,C3,D4 -->
|
|
103
|
+
<!-- EXPLANATION: Low temperature yields deterministic outputs; high temperature increases variety. Low top-p restricts to high-probability tokens; high top-p allows broader sampling. -->
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# LLM Fundamentals — Resources
|
|
2
|
+
|
|
3
|
+
## Official & Research
|
|
4
|
+
|
|
5
|
+
- [Anthropic Research](https://www.anthropic.com/research) — Claude safety, scaling, and capabilities.
|
|
6
|
+
- [Attention Is All You Need](https://arxiv.org/abs/1706.03762) — Original transformer paper (Vaswani et al.).
|
|
7
|
+
|
|
8
|
+
## Videos
|
|
9
|
+
|
|
10
|
+
- [3Blue1Brown — Neural Networks](https://www.youtube.com/watch?v=aircAruvnKk) — Visual intuition for neural networks.
|
|
11
|
+
- [Andrej Karpathy — State of GPT](https://www.youtube.com/watch?v=bZQun8Y4L2A) — How GPT models work, training, and inference.
|
|
12
|
+
- [Andrej Karpathy — Intro to Large Language Models](https://www.youtube.com/watch?v=zjkBMFhNj_g) — Conceptual overview of LLMs.
|
|
13
|
+
- [AI Explained — How do LLMs work?](https://www.youtube.com/results?search_query=AI+Explained+LLM) — Accessible explainers.
|
|
14
|
+
|
|
15
|
+
## Articles
|
|
16
|
+
|
|
17
|
+
- [Lilian Weng — LLM Survey](https://lilianweng.github.io/posts/2023-01-10-the-gen-ai-layer/) — Overview of the LLM stack.
|
|
18
|
+
- [Chip Huyen — LLM Observability](https://huyenchip.com/) — Production considerations.
|
|
19
|
+
- [Simon Willison — LLMs](https://simonwillison.net/series/llms/) — Practical LLM usage.
|
|
20
|
+
|
|
21
|
+
## Books
|
|
22
|
+
|
|
23
|
+
- **Build a Large Language Model (From Scratch)** by Sebastian Raschka — Implement an LLM step by step.
|
|
24
|
+
- **AI Engineering** by Chip Huyen — Production ML and LLM systems.
|
|
25
|
+
|
|
26
|
+
## Tools
|
|
27
|
+
|
|
28
|
+
- [OpenAI Tokenizer](https://platform.openai.com/tokenizer) — See how text is tokenized.
|
|
29
|
+
- [tiktoken](https://github.com/openai/tiktoken) — OpenAI's tokenizer library for Python.
|
|
30
|
+
- [Claude API](https://docs.anthropic.com/en/api/getting-started) — Experiment with context and temperature.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# How LLMs Work — Walkthrough
|
|
2
|
+
|
|
3
|
+
## Step 1: Tokenization — Breaking Text into Pieces
|
|
4
|
+
|
|
5
|
+
Before an LLM can process your text, it splits it into tokens — subword units that the model understands.
|
|
6
|
+
|
|
7
|
+
**Task:** Go to the OpenAI Tokenizer (https://platform.openai.com/tokenizer) or think manually: how would the sentence "I'm learning about tokenization" get split into tokens? Try splitting it yourself, then check.
|
|
8
|
+
|
|
9
|
+
**Question:** Why do you think LLMs use subword tokens instead of whole words or individual characters? What trade-off does tokenization make?
|
|
10
|
+
|
|
11
|
+
**Checkpoint:** The learner should understand that subword tokenization balances vocabulary size with coverage — common words get one token, rare words are split into pieces, and no word is ever "unknown."
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Step 2: Embeddings — From Tokens to Numbers
|
|
16
|
+
|
|
17
|
+
<!-- hint:card type="concept" title="Embeddings" -->
|
|
18
|
+
|
|
19
|
+
Tokens are discrete symbols. The model needs continuous numbers to compute with. Each token gets mapped to a high-dimensional vector called an embedding.
|
|
20
|
+
|
|
21
|
+
**Task:** Consider the words "king", "queen", "man", "woman". If these are represented as vectors, what relationships would you expect between them? Sketch out (on paper or mentally) how you'd arrange them in 2D space.
|
|
22
|
+
|
|
23
|
+
**Question:** The famous word2vec result is: king - man + woman ≈ queen. What does this tell you about what embeddings capture? Is it just spelling, or something deeper?
|
|
24
|
+
|
|
25
|
+
**Checkpoint:** The learner should understand that embeddings encode semantic meaning — words with similar meanings have similar vectors, and relationships between words are preserved as directions in vector space.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Step 3: Attention — The Core Mechanism
|
|
30
|
+
|
|
31
|
+
<!-- hint:card type="concept" title="Attention" -->
|
|
32
|
+
<!-- hint:diagram mermaid-type="flowchart" topic="transformer architecture" -->
|
|
33
|
+
|
|
34
|
+
The transformer architecture's key innovation is the attention mechanism. It lets each token "look at" every other token to understand context.
|
|
35
|
+
|
|
36
|
+
**Task:** Consider the sentence: "The bank by the river was steep." Now consider: "The bank approved my loan." The word "bank" appears in both. How would a model figure out which meaning is intended?
|
|
37
|
+
|
|
38
|
+
**Question:** Why is attention described as letting tokens "attend to" each other? What would happen if a model could only see tokens in order (left to right) without attention?
|
|
39
|
+
|
|
40
|
+
**Checkpoint:** The learner should understand that attention allows each token to weigh the relevance of all other tokens, resolving ambiguity based on context. Without attention, the model would struggle with long-range dependencies.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Step 4: Context Windows — Memory Limits
|
|
45
|
+
|
|
46
|
+
Every LLM has a maximum context window — the total number of tokens it can process at once (input + output). Claude's context window is 200K tokens; GPT-4 ranges from 8K to 128K.
|
|
47
|
+
|
|
48
|
+
**Task:** Estimate: roughly how many pages of text fit in a 100K-token context window? (Hint: a typical page is ~300 words, and English averages ~1.3 tokens per word.)
|
|
49
|
+
|
|
50
|
+
**Question:** If an LLM can only "see" what's in its context window, what happens when you ask about something mentioned 150K tokens ago in a long conversation? Does the model remember it the same way you would?
|
|
51
|
+
|
|
52
|
+
**Checkpoint:** The learner should understand that LLMs have no persistent memory beyond the context window, that information early in a very long context may get less attention ("lost in the middle" phenomenon), and that ~100K tokens is roughly 250 pages.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Step 5: Next-Token Prediction and Temperature
|
|
57
|
+
|
|
58
|
+
LLMs generate text one token at a time by predicting the most probable next token given all previous tokens. The temperature parameter controls how "creative" the selection is.
|
|
59
|
+
|
|
60
|
+
**Task:** Imagine the model is completing: "The capital of France is ___". At temperature 0, it always picks the highest-probability token. At temperature 1, it samples from the distribution. What output would you expect at each temperature?
|
|
61
|
+
|
|
62
|
+
**Question:** If temperature 0 always picks the most likely token, why would you ever want higher temperature? What tasks benefit from predictability vs. creativity?
|
|
63
|
+
|
|
64
|
+
**Checkpoint:** The learner should understand that temperature 0 gives deterministic, focused output (good for factual Q&A), higher temperatures introduce variety (good for creative writing), and very high temperatures produce incoherent text.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Step 6: Why LLMs Hallucinate
|
|
69
|
+
|
|
70
|
+
LLMs sometimes generate confident-sounding but incorrect information. This isn't a bug — it's a consequence of how they work.
|
|
71
|
+
|
|
72
|
+
**Task:** Ask an LLM a very specific factual question about something obscure (e.g., "What was the population of a small town in 1987?"). Compare the answer to a verified source. Does the model hedge or state it confidently?
|
|
73
|
+
|
|
74
|
+
**Question:** LLMs are fundamentally pattern-completion machines. Given that they predict the next most likely token, why would they generate false information with high confidence instead of saying "I don't know"?
|
|
75
|
+
|
|
76
|
+
**Checkpoint:** The learner should understand that LLMs don't have a "knowledge" store they query — they complete patterns from training data. "I don't know" is rarely the most probable continuation, so the model defaults to plausible-sounding completions. RLHF helps but doesn't eliminate the problem.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Step 7: Choosing the Right Model
|
|
81
|
+
|
|
82
|
+
<!-- hint:buttons type="single" prompt="Which task needs a large model?" options="Classify tickets,Technical architecture,Short translation" -->
|
|
83
|
+
<!-- hint:celebrate -->
|
|
84
|
+
|
|
85
|
+
Different tasks call for different models. Larger models aren't always better — they're slower and more expensive.
|
|
86
|
+
|
|
87
|
+
**Task:** You have three tasks: (1) classify customer support tickets into 5 categories, (2) write a detailed technical architecture document, (3) translate short phrases to Spanish. For each, would you choose a small/fast model or a large/powerful one? Why?
|
|
88
|
+
|
|
89
|
+
**Question:** What factors should you consider when choosing a model besides raw capability? Think about latency, cost, context window, and task complexity.
|
|
90
|
+
|
|
91
|
+
**Checkpoint:** The learner should understand the trade-offs: small models for simple/high-volume tasks (classification, extraction), large models for complex reasoning and generation, and that cost and latency matter as much as capability in production systems.
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Effective 1:1s — Conversations That Build Trust and Growth
|
|
2
|
+
|
|
3
|
+
<!-- hint:slides topic="1:1 meeting essentials: purpose, cadence, preparation, agenda structure, and anti-patterns" slides="5" -->
|
|
4
|
+
|
|
5
|
+
## The Purpose of 1:1s
|
|
6
|
+
|
|
7
|
+
A one-on-one is **their meeting, not yours**. Its purpose is to give your report space to talk about what matters to them: career growth, blockers, feedback, or just venting. When 1:1s become status reports or your agenda only, trust erodes and the meeting loses value.
|
|
8
|
+
|
|
9
|
+
**Andy Grove** (High Output Management) argued that a manager's most valuable role is one-on-one time. **Camille Fournier** (The Manager's Path) emphasizes: the report should own the agenda. Your job is to listen, ask questions, and support.
|
|
10
|
+
|
|
11
|
+
## Cadence: How Often?
|
|
12
|
+
|
|
13
|
+
| Situation | Cadence | Why |
|
|
14
|
+
|-----------|---------|-----|
|
|
15
|
+
| New team member | Weekly | They need more guidance and relationship-building |
|
|
16
|
+
| Established report | Biweekly | Enough rhythm without overwhelming |
|
|
17
|
+
| Senior / highly autonomous | Biweekly or monthly | They self-manage; less frequent is fine |
|
|
18
|
+
|
|
19
|
+
**Rule of thumb:** Never cancel 1:1s for "no urgent topics." The meeting *is* the relationship.
|
|
20
|
+
|
|
21
|
+
## Preparation: The Shared Doc
|
|
22
|
+
|
|
23
|
+
Use a **shared document** (Notion, Google Doc, etc.) that both you and your report can edit. The report adds topics before the meeting; you add yours. This:
|
|
24
|
+
|
|
25
|
+
- Ensures nothing gets forgotten
|
|
26
|
+
- Signals you take the meeting seriously
|
|
27
|
+
- Gives you both time to think
|
|
28
|
+
|
|
29
|
+
**Example doc structure:**
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
## Report's Topics
|
|
33
|
+
- Want to discuss promotion timeline
|
|
34
|
+
- Feedback on last week's presentation
|
|
35
|
+
|
|
36
|
+
## Manager's Topics
|
|
37
|
+
- Career check-in
|
|
38
|
+
- Project X handoff
|
|
39
|
+
|
|
40
|
+
## Notes (post-meeting)
|
|
41
|
+
- Agreed to revisit promotion in 6 months with stretch goals
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Agenda Structure
|
|
45
|
+
|
|
46
|
+
```mermaid
|
|
47
|
+
flowchart TD
|
|
48
|
+
A[Start: Rapport check-in] --> B[Report's topics first]
|
|
49
|
+
B --> C[Manager's topics]
|
|
50
|
+
C --> D[Career / growth discussion]
|
|
51
|
+
D --> E[Action items + next 1:1 date]
|
|
52
|
+
E --> F[End]
|
|
53
|
+
|
|
54
|
+
style B fill:#3fb950
|
|
55
|
+
style C fill:#58a6ff
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Order matters:** Report's topics first. Their concerns, blockers, and ideas set the tone. Your topics (feedback, announcements) come second. Career and growth get dedicated time—don't rush them.
|
|
59
|
+
|
|
60
|
+
## Types of Conversations
|
|
61
|
+
|
|
62
|
+
| Type | What It Looks Like | Your Role |
|
|
63
|
+
|------|-------------------|-----------|
|
|
64
|
+
| **Career growth** | Goals, promotion, skills, stretch assignments | Ask questions; sponsor and advocate |
|
|
65
|
+
| **Feedback** | Delivering or receiving feedback (use SBI) | Be specific; ask what support they need |
|
|
66
|
+
| **Blockers** | Technical, interpersonal, or process | Help remove; don't solve for them |
|
|
67
|
+
| **Coaching** | They're stuck; you help them think | Questions > answers; Socratic method |
|
|
68
|
+
| **Venting** | Frustration, stress, team dynamics | Listen; don't fix; validate feelings |
|
|
69
|
+
|
|
70
|
+
**Example — Coaching vs Fixing:** They say "I'm stuck on the API design." Instead of "Here's how I'd do it," try: "What have you tried? What's blocking you? What would success look like?"
|
|
71
|
+
|
|
72
|
+
## Asking Good Questions
|
|
73
|
+
|
|
74
|
+
- **Open-ended:** "What's on your mind?" "What would make this week a success?"
|
|
75
|
+
- **Follow-up:** "Tell me more." "What happened next?" "How did that feel?"
|
|
76
|
+
- **Silence:** After asking, *wait*. Give them 3–5 seconds. They'll often fill it with the real answer.
|
|
77
|
+
|
|
78
|
+
**Lara Hogan** recommends: "What's the best use of our time today?" as an opener—lets them steer.
|
|
79
|
+
|
|
80
|
+
## Managing Up: 1:1s With Your Manager
|
|
81
|
+
|
|
82
|
+
Your 1:1s with your manager are also *your* meeting. Prepare topics: wins to share, decisions you need, blockers, career asks. Don't show up empty-handed. Your manager benefits from your clarity.
|
|
83
|
+
|
|
84
|
+
## Skip-Level 1:1s
|
|
85
|
+
|
|
86
|
+
When you're a skip-level (manager of managers), periodic 1:1s with your reports' reports build trust and surface issues. Keep them lighter and less frequent (e.g., quarterly). Don't undermine your managers—frame it as "I want to hear from you directly."
|
|
87
|
+
|
|
88
|
+
## Common Anti-Patterns
|
|
89
|
+
|
|
90
|
+
| Anti-Pattern | Better Practice |
|
|
91
|
+
|-------------|-----------------|
|
|
92
|
+
| Status updates only | Use standups for status; 1:1s for growth, feedback, blockers |
|
|
93
|
+
| Cancelling frequently | 1:1s are sacrosanct; reschedule, don't cancel |
|
|
94
|
+
| Only when things go wrong | Regular cadence builds trust; crisis-only = anxiety |
|
|
95
|
+
| Manager does all the talking | Report's topics first; 70% them, 30% you |
|
|
96
|
+
| No preparation | Shared doc; both add topics before meeting |
|
|
97
|
+
| Rushing through | Block 30–60 min; don't squeeze between back-to-backs |
|
|
98
|
+
|
|
99
|
+
## 1:1 Meeting Flow
|
|
100
|
+
|
|
101
|
+
```mermaid
|
|
102
|
+
flowchart LR
|
|
103
|
+
subgraph Prep["Before"]
|
|
104
|
+
P1[Report adds topics]
|
|
105
|
+
P2[Manager adds topics]
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
subgraph Meeting["During"]
|
|
109
|
+
M1[Rapport — 2 min]
|
|
110
|
+
M2[Report's topics — 15 min]
|
|
111
|
+
M3[Manager's topics — 10 min]
|
|
112
|
+
M4[Career / growth — 8 min]
|
|
113
|
+
M5[Action items — 5 min]
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
subgraph After["After"]
|
|
117
|
+
A1[Update shared doc]
|
|
118
|
+
A2[Schedule next 1:1]
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
P1 --> M1
|
|
122
|
+
P2 --> M1
|
|
123
|
+
M5 --> A1
|
|
124
|
+
A1 --> A2
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Quick Tips
|
|
128
|
+
|
|
129
|
+
1. **Same time, same day** — Predictability helps both of you protect the slot.
|
|
130
|
+
2. **Camera on (remote)** — Builds connection; treat it like an in-person conversation.
|
|
131
|
+
3. **Take notes** — In the shared doc; you'll forget commitments otherwise.
|
|
132
|
+
4. **Follow up** — If you said you'd do something, do it. Trust compounds.
|
|
133
|
+
5. **Adjust over time** — As the relationship matures, adapt cadence and structure.
|