Lesson 4

🧠 How LLMs Actually Think

Tokenization, embeddings, and your play style

⏱️ 45 min πŸ“Š Intermediate πŸš€ Build: Personal Embeddings RAG

🎯 How LLMs Actually Think

45 minutes to go from "magic black box" to understanding tokenization, embeddings, RAG, and context windows. You'll build a personal RAG knowledge base of your Arcade play style that gives you (and your agents) superhuman strategy advice.

🧠
Tokens β†’ Embeddings β†’ Reasoning

LLMs don't "think" like humans. They predict next tokens based on massive vector math. Understanding this lets you control them.

πŸš€ What You'll Build

A personal embeddings RAG system: upload your game notes, past matches, and strategies β†’ query "What should I do in Level 7 given my aggressive play style?" The system retrieves relevant chunks and generates tailored advice. Hash the knowledge base root on Citrea for on-chain verifiability.

πŸ“š Quick Concepts

  • Tokenization: Breaking text into tokens (roughly ΒΎ word each) that the model processes.
  • Embeddings: High-dimensional vectors that capture semantic meaning.
  • RAG (Retrieval-Augmented Generation): Fetch relevant documents before prompting to reduce hallucinations.
  • Context Window: Maximum tokens the model can "see" at once (e.g., 128k for modern models).

πŸ”¨ Build Steps

  1. Collect your game notes and past plays.
  2. Chunk + embed with OpenAI/Grok embeddings API (or free local model).
  3. Store in vector DB (Chroma or Pinecone free tier).
  4. Build a simple retrieval + prompt chain (LangChain or LlamaIndex).
  5. Deploy as web app or Discord slash command.
  6. Hash the index manifest and store on Citrea as proof of your personal knowledge base.

πŸ“Š UTXOs vs Bank Balances

🏦

Bank Account

Running balance: $150. Add $50, now $200. Subtract $30, now $170. Just numbers in a database.

β‚Ώ

Bitcoin UTXOs

Discrete coins: 0.5 BTC + 0.3 BTC + 0.2 BTC. Each is a separate, trackable unit with its own history.

οΏ½ The Aha Moment: Build a Transaction

Let's build a Bitcoin transaction visually. You'll see how inputs, outputs, and fees work together.

πŸ’Έ Try It: Transaction Builder
Interactive
⬇️ Inputs (What you're spending)

UTXO #1: 0.5 BTC from previous transaction

➑️ Outputs (Where it goes)

To recipient: 0.3 BTC
Change back to you: 0.199 BTC

⚑ Fee (The difference)

Miner fee: 0.001 BTC (0.5 - 0.3 - 0.199 = 0.001)

πŸ”’
Key Concept

All inputs must be fully spent. If you don't specify change, the difference becomes the miner fee!

πŸ’° Transaction Fees

Fees are paid per byte of data, not per amount sent. A transaction sending $10 costs the same as one sending $10 million.

πŸ“
What Affects Fee Size?

More inputs = larger transaction = higher fee. Consolidating many small UTXOs costs more than spending one large UTXO.

πŸ’‘
Pro Tip: UTXO Consolidation

When fees are low, combine small UTXOs into larger ones. This saves fees on future transactions.

⏳ The Mempool

The mempool is the waiting room for unconfirmed transactions. Miners pick transactions based on fee rate (satoshis per byte).

🐒

Low Priority

1-5 sat/vB: May take hours or days

🚢

Medium Priority

10-20 sat/vB: Usually next few blocks

πŸš€

High Priority

50+ sat/vB: Next block likely

βœ… Confirmations

Each new block adds one confirmation to your transaction. More confirmations = more security.

πŸ”’
Confirmation Guidelines

1 confirmation: Okay for small amounts
3 confirmations: Good for most transactions
6 confirmations: Standard for large amounts (~1 hour)

πŸ›οΈ Austrian Economics Corner

πŸ“š

Final Settlement & Property Rights

Unlike credit card payments that can be reversed for months, Bitcoin transactions are irreversible by design. This enables trustless commerceβ€”you don't need to trust the buyer won't reverse the payment.

Austrian economists emphasize clear property rights. Bitcoin's UTXO model provides absolute clarity: each coin has one owner, no fractional claims, no rehypothecation.

"Bitcoin transactions represent true final settlement - no chargebacks, no reversals, no counterparty risk." β€” Bitcoin Protocol Design
βš–οΈ
Why This Matters

Final settlement eliminates counterparty risk. Once confirmed, no institution can reverse your transaction or freeze your funds. True property rights.

🎬

Watch: Understanding Bitcoin Transactions

15:00

🧠 Teach Satoshi

Before the quiz, prove you understand by explaining the concept. Satoshi AI will challenge your thinking until you achieve mastery.

πŸ“ Check Your Understanding

Complete the quiz to unlock the next lesson. You need 80% to pass.

Continue to Lesson 5: Mining & Proof-of-Work