HomeEncyclopedia › Fundamentals

fundamental icon

AI Prompting Fundamentals

This section outlines the basic definitions and operational mechanics governing the interaction between users and Large Language Models (LLMs). Understanding these foundations is necessary for accurate and predictable machine output.


To understand how Large Language Models operate, one must define the foundational terms governing their function and data processing.

Artificial Intelligence (AI) →

A field of computer science dedicated to creating systems capable of executing tasks that typically require human cognition, such as reasoning, pattern identification, and decision-making.

Large Language Model (LLM) →

A machine learning system trained on datasets to predict subsequent sequences in text. These models utilize neural networks to identify patterns across billions of parameters.

Token →

The basic unit of data for LLMs. Models break text into smaller segments – often fragments of words – and convert them into numeric identifiers for processing.

Prompt Engineering →

The practice of crafting and refining instructions to get the best results from AI. It involves structuring inputs to guide a model toward the most accurate and useful output.

Context Window →

The limit of data a model processes during a single interaction. This includes all previous messages, user inputs, and generated text. Once data exceeds this limit, the model ceases to recall earlier information.

Embedding →

The translation of text into numeric vectors. This format allows the model to measure the mathematical distance between concepts. Words with similar meanings appear closer together in this vector space.

Inference →

The operational stage where the model receives input and calculates an output. This represents the actual execution of the model after the training phase is complete.

Hallucination →

A state where a model produces an output that appears factual but lacks a basis in the input data or reality. This occurs because the model prioritizes pattern matching over fact verification.

Prompt →

The input provided to a model. It contains the instructions and data necessary to generate a response.

Temperature →

A hyperparameter that controls the randomness and creativity of an AI’s response. Lower settings make the model predictable and focused, which is ideal for factual or technical tasks. Higher settings introduce variability, encouraging the model to generate more diverse or creative content.

Primary Mechanics of Prompting

The interaction between a user and an LLM relies on specific operational mechanics that dictate the output quality.

1. Instruction

Models function based on directives. Clear, imperative commands reduce ambiguity. Providing an explicit role for the model (e.g., “Act as a technical editor”) establishes a persona that constrains the output style and vocabulary.

2. Context Provision

Models rely on input data to generate relevant content. Providing background information, examples, or source material allows the model to align its response with user requirements.

3. Output Formatting

Users can dictate the structure of the returned data. Specifying a format (e.g., table, JSON, bulleted list, or plain text) allows for the direct application of model outputs in downstream processes.

4. Parameter Control

While interfaces vary, most LLMs allow adjustment of settings that affect output variability:

  • Temperature: Controls randomness. A lower setting makes the model return deterministic results, while a higher setting increases variety.
  • Top-P (Nucleus Sampling): Determines the range of token choices the model considers.
  • Max Tokens: Sets a hard limit on the length of the generated response.

Interaction Loop

The input-output cycle follows a sequential path:

  • Input: The user submits a prompt containing instructions and context.
  • Processing: The model tokenizes the input and calculates the probability of successive tokens based on its training data and parameters.
  • Output: The model generates the response until it reaches a stop sequence, token limit, or user intervention.

Effective prompting requires maintaining a balance between instruction length and the context window to ensure the model remains focused on the primary task.