Loading...

Loading...

The Magic LLM Triangle
Loading like and share buttons...
#prompt#llm#softwaredevelopment#ml

The Magic LLM Triangle

Tomer Raitz
Tomer Raitz
Jan 193 min read

Before we start working with AI Coding tools, we need to understand the basics of how an LLM (Large Language Model) works. There are 3 main components that we need to master.

1. The Model

The model is the “brain” of the operation. To use AI for coding, you need a model that has been trained on the right data.

What kind of data?

  • General Language Understanding (Pre-training): First, the model needs to understand human language. Think of it like this: if your manager asks you to code in a language you don't speak (like Chinese), you can't complete the task. The model first reads massive amounts of text to learn grammar, logic, and meaning.
  • Alignment & Feedback (RLHF): Once the AI understands English, we need to ensure it gives good answers. We use a process called "Human in the Loop" (RLHF). Humans rate the AI's answers as "Helpful" or "Not Helpful," teaching the model to distinguish between a technically correct answer and a truly useful one.
    • Note: Because this process relies on human feedback, it inherently introduces human bias into the data (we will cover this in more advanced subjects later).
  • Domain Specificity (Fine-Tuning): Finally, general knowledge isn't enough. If you want the AI to build a website, it needs to see specific examples of code, testing frameworks, and deployment scripts. We feed it Domain-Specific Data so it becomes an expert in coding rather than just a general chatterbox.

2. The Prompt

To "talk" effectively with the LLM, we need good input. Here are the main concepts you need to understand regarding prompting:

  • Clear Instructions: The most important rule of prompting is clarity. Make sure the AI understands the specific task before it executes anything.
  • Examples (Few-Shot Learning): Sometimes you need to show examples of how you want the output to look. This helps the LLM align with your specific style or requirements.
  • Chain of Thought (CoT): For complex tasks, you need to activate the LLM's "reasoning" capabilities. This is often done by asking the model to "think step-by-step" or by using specific Reasoning Models (like o1 or R1) for highly complex logic.
  • Context Overload: If the prompt contains too much data unrelated to the task, it can confuse the LLM, as it struggles to distinguish between relevant and irrelevant information.
    • We will talk more about Prompt Engineering techniques in another post.

3. Context

Each AI coding tool works in a “session,” and each session has a Context Window. This is the limit of how much information the AI can "remember" at one time.

What is inside the Context Window?

  • System Prompts / Tools: Every AI coding tool has its own hidden context, including commands, defined skills, sub-agents, and system prompts. It also includes access to capabilities like reading, editing, or deleting files.
  • MCP (Model Context Protocol): If you have an MCP server installed in your project, the AI can pull context from it. It doesn't load the whole protocol, but rather the specific tools and data defined in the MCP.
    • Note: A new concept called "Dynamic Tool Loading" is now being implemented by most AI coding products to manage this efficiently.
  • User Prompt: Your current input is always part of the active context.
  • Session History: The LLM saves the history of your chat in the current session. This allows it to understand what the session is about and refer back to previous instructions.
    • We will talk more about Context Engineering in another post.

Comments

0 comments

Enter your comment. Maximum 2000 characters.

No comments yet. Be the first to share your thoughts!
Vibki logo wave icon
Vibki Surfing Bot
Vibki

Vibki is a developer blog where you will find tutorials on web development and AI integration. Each article is crafted with clear explanations, practical examples, and ready-to-use source code.

Talk to me
Copy email
LinkedIn
GitHub
Dev.to