back to research
aiml

The Hidden Language of AI

Understanding the representations and patterns that emerge inside neural networks.

Prasad·May 1, 2024

Large Language Models (LLMs) are like super-smart interns -- they can do amazing work, but only if you give them the right instructions. The way you phrase your request -- your prompt -- can be the difference between a perfect answer and a confusing mess.

LLMs don't think like humans. They predict the next token based on your input and their training data. The quality of your prompt directly impacts the quality of the output.

  • Prompt -- The input you give to an LLM.
  • System Prompt -- The hidden or initial instruction that sets the model's behavior for the entire conversation.

What Is a System Prompt?

A system prompt is the invisible briefing that sits at the top of the conversation, defining who the model is, how it speaks, and what it's allowed to do.

{"role": "system", "content": "You are a helpful assistant that explains concepts in simple terms."}
json

Why it matters:

  • Sets context before any user input.
  • Controls style, persona, and boundaries.
  • Ensures consistency across multiple responses.
💡

Analogy: Think of it like a job description you give someone before they start working.


Prompting Standards Across Models

Alpaca Prompting

### Instruction:
What is System Prompting?
### Response:
plain text

INST Formatting (LLaMA-2)

[INST] What is System Prompting? [/INST]
plain text

FLAN-T5

Question: What is System Prompting?
Answer:
plain text

ChatML (OpenAI) -- most widely used

[{"role": "system", "content": "You are a helpful assistant"},
 {"role": "user", "content": "What is System Prompting?"}]
json

Zero-Shot Prompting

Zero-shot prompting means the prompt won't contain examples or demonstrations. We ask the model to perform a task without giving examples.
User: Translate "Hello" to French.
AI: Bonjour
plain text

When to use:

  • The task is simple and well-known to the model.
  • You want quick results without spending tokens on examples.
  • You're testing the model's baseline ability.

Few-Shot Prompting

Few-shot prompting provides demonstrations in the prompt to steer the model toward better performance. We provide a few examples before asking the model to perform the task.
English: Hello -> French: Bonjour
English: Good morning -> French: Bonjour matin
English: Thank you -> French:

AI: Merci
plain text

When to use:

  • The task requires a specific format or style.
  • You want more consistent results than zero-shot.
  • The model might be uncertain without guidance.

Chain-of-Thought (CoT) Prompting

CoT prompting asks the model to show its intermediate reasoning rather than jumping straight to the final answer.

Variants:

  • Auto-CoT: Automatically generates reasoning examples from labeled data, no manual design needed.
  • Plan-and-Solve: First Plan (break into subtasks), then Solve (tackle each subtask).

Without CoT vs With CoT:

Without: Q: 23 apples, 20 used, 6 bought. How many? A: 9 (guessed)

With:
1. Started with 23 apples.
2. Used 20, so 23 - 20 = 3.
3. Bought 6 more, so 3 + 6 = 9.
Final answer: 9.
plain text

Self-Consistency Prompting

Self-consistency prompting improves reliability by sampling multiple independent reasoning paths and selecting the most common final answer.

Why it helps:

  • A single CoT run can get stuck in a wrong path.
  • Multiple samples explore different reasoning trajectories.
  • Majority voting tends to cancel out outliers and reduce hallucinations.

Persona-Based Prompting

Persona-based prompting sets a specific role, expertise level, tone, and constraints so the model responds like a particular personality or professional.

Core components:

  • Role and seniority: 'Senior JavaScript developer,' 'Principal SRE,' 'Professor of Economics'
  • Audience: 'for junior devs,' 'for business stakeholders,' 'for non-technical users'
  • Style/tone: 'concise,' 'empathetic,' 'Socratic,' 'hands-on'
  • Output format: bullets, numbered steps, code-first, ELI5
  • Constraints: 'no jargon without definitions,' 'keep to 150 words,' 'cite 2 sources'

Conclusion

Crafting clear, structured prompts is the difference between generic AI responses and truly intelligent collaboration. Techniques like chain-of-thought, few-shot examples, self-consistency, and persona-based prompts are essential tools that unlock the model's potential.

  • Experiment boldly: mix system prompts with few-shot, CoT, persona-based setups.
  • Test across models -- different formats may yield surprising improvements.
  • Share what works (and what doesn't) -- prompt engineering is still a collective frontier.