INNOVATION

How LLMs (Large Language Model) choose next action

How do an AI model like ChatGPT and Google Gemini decide their next move in a conversation or workflow? This question sits at the heart of understanding how LLMs choose next action: a process that determines the accuracy, relevance, and overall effectiveness of AI-driven interactions. A Large Language Model (LLM) operates by predicting the next...

Last updated: 9 Sep 2025

CONTENTS

How do an AI model like ChatGPT and Google Gemini decide their next move in a conversation or workflow? This question sits at the heart of understanding how LLMs choose next action: a process that determines the accuracy, relevance, and overall effectiveness of AI-driven interactions.

A Large Language Model (LLM) operates by predicting the next word, phrase, or instruction based on the context it receives. While this may sound simple, it involves complex probability calculations, transformer-based architectures for context management, and adjustments informed by historical data. For B2B, eCommerce, and SEO strategies, understanding this process means gaining greater control over chatbot performance, product recommendations, and personalized content delivery.

In this article, we will break down the mechanisms behind how LLMs determine the “next action,” explore the prompting techniques that influence these decisions, and highlight insights from practitioners like Luca Fancello that can help you design AI workflows with precision and measurable business impact.

Understanding the core mechanism of Large Language Model decision-making

At their core, Large Language Models are probability engines. An LLM such as GPT-5 predicts a distribution over the next token given the current context, then selects or samples the next token according to a decoding strategy. This loop repeats step by step to produce coherent outputs. Tokens are the basic units the model reads and writes, covering whole words, subwords, spaces, and punctuation.

This prediction process is enabled by the Transformer architecture, whose attention layers learn which parts of the prompt matter most when inferring the next action. In practice, that means the model can consider long-range dependencies without recurrence and still stay efficient at scale.

You can think of the decision flow in four steps:

  1. Tokenization: Split the input into tokens that the model can process.
  2. Context mapping: Attention layers compute relationships among tokens.
  3. Probability distribution: The model assigns log-probabilities to all candidate next tokens.
  4. Decoding: Choose the next token via greedy selection or sampling; common controls include temperature and top_p nucleus sampling.

Decoding details matters. Lower temperature pushes outputs toward more deterministic answers, while higher temperature increases variability. Nucleus sampling limits choices to the smallest set of tokens whose cumulative probability reaches a threshold top_p, a method introduced to reduce bland or repetitive text during generation.

Large Language Model example Chat GPT

Finally, GPT-5 itself is documented by OpenAI as the current flagship model, with a system card describing how it routes tasks and when it engages deeper reasoning. Referencing those materials helps anchor any discussion of next-action behavior in an up-to-date model specification.

Expert perspectives on how Large Language Models choose next action

A key reference for understanding how LLMs choose next action when it comes to citing or crawling websites is Jérôme Salomon’s LinkedIn post. As a senior technical SEO expert at Oncrawl, he broke down the process of how ChatGPT Search evaluates and selects which sources to crawl and include in its answers.

The ChatGPT search process

Based on Jérôme’s research and direct conversations with the support team, the steps behind ChatGPT Search can be summarised as follows:

  1. Prompt transformation: the user prompt is converted into one or more queries.
  2. Search engine response: Bing sends back a list of results, including URLs, titles, snippets, and metadata.
  3. Source selection: ChatGPT chooses relevant results and sends its bot to crawl the content in real time.
  4. Citation: the crawled content is then included in the final answer with inline citations.

This means the model’s “next action” is not only predicting the next token but also deciding which external sources to trust and bring into the response.

The four criteria for source selection

ChatGPT relies on four main criteria when deciding which sites to crawl:

  • Title: How descriptive and aligned it is with the query.
  • Snippet/meta description: the clarity and accuracy of the preview text.
  • Freshness: whether the content is up to date.
  • Domain credibility: the authority of the site (Important: “domain authority” here isn’t a technical score like Moz’s – it’s simply the model’s perception of trust based on its training data.)

Together, these factors shape the model’s next action in terms of external citations. Titles and meta descriptions remain crucial signals, echoing traditional SEO fundamentals but reframed in a generative AI context.

Actionable tips for brands

For businesses aiming to appear as a cited source in ChatGPT Search or similar generative systems, it is recommended to:

  • Write descriptive, specific, and accurate titles.
  • Ensure your meta descriptions reflect the actual content.
  • Prioritise clarity over clickbait.

By aligning site metadata with these selection signals, brands can improve the likelihood that an LLM will choose their content as the next action in a search-driven interaction. This analysis focuses on ChatGPT Search. Other LLM-powered engines, such as Google Gemini, Bing Copilot, or Perplexity AI may apply similar but distinct selection processes depending on their training data, retrieval pipelines, and citation policies.

Prompting strategies that influence next action

The way you prompt an LLM directly shapes how it chooses the next action. Beyond the underlying transformer mechanics, the structure and clarity of the prompt act as guardrails that guide decision quality.

Zero-shot, one-shot, and few-shot prompting

Different prompting styles change how much context the model has before making a decision:

  • Zero-shot: the model is asked to act without examples. Useful for general instructions, but may lead to generic or uncertain actions.
  • One-shot: the prompt includes a single example to anchor the response. This helps the model align more closely with the desired action format.
  • Few-shot: the prompt includes multiple examples, giving the model a stronger pattern to follow. Few-shot prompting is particularly effective in narrowing the model’s next action within complex workflows.

Research has shown that few-shot prompting can significantly improve accuracy, especially for reasoning tasks or structured outputs. For businesses, this means you can reduce variability in customer-facing chatbots or automated marketing flows by seeding prompts with examples that match your tone and objectives.

The role of historical and contextual data

Context history is another major factor in determining the model’s next action. The longer the conversation window, the more signals the model can weigh before acting. However, too much context can cause hallucinations or exceed the model’s token limits.

One study on long-context LLMs highlighted that relevant historical context improves output precision, but irrelevant or excessive context can dilute accuracy. This makes context curation a critical skill: knowing which parts of history to retain and which to drop.

In practice:

  • For support bots, include recent conversation history plus the ticket status, but avoid dumping entire customer records.
  • For SEO and content automation, provide structured metadata such as product attributes or geo-targeted keywords to help the LLM align next actions with search intent.
  • For eCommerce recommendations, feed in session-specific data (cart contents, browsing category) rather than full order history to keep the model focused.

Designing prompts for decision quality

Clear prompts consistently outperform long or vague ones. The most effective prompts usually contain:

  • a single clear objective
  • a defined set of allowed actions
  • concise inputs (structured if possible)
  • explicit decision rules for selecting the next action

OpenAI’s prompt engineering guide underscores this principle: precision in wording often leads to higher instruction-following accuracy than adding extra detail without structure.

Practical applications for B2B, eCommerce, and SEO

Understanding how LLMs choose next action is not only useful for technical AI design but also for business applications where precision directly impacts revenue and visibility.

Smarter chatbots and support flows

In B2B and eCommerce, customer support bots often face branching decisions: provide an FAQ answer, escalate to human support, or trigger a workflow. Structuring prompts with explicit decision rules ensures the LLM selects the most efficient next action. For example, adding a simple instruction such as “only escalate if no knowledge base match is found” can reduce unnecessary handovers and improve response time.

Personalised marketing automation

Marketing teams using platforms like Shopify or Klaviyo can design LLM-powered campaigns that adapt to customer signals in real time. By feeding in session data, product preferences, and engagement history, the model can choose the next action: send a reminder email, generate a discount code, or recommend a complementary product. This bridges predictive AI with actionable retention strategies.

Content optimisation for generative search

Generative AI is reshaping how content gets discovered. Since ChatGPT and other AI engines select sources based on signals like titles, snippets, freshness, and credibility, aligning metadata with these criteria helps brands become “the chosen source.” This is where Generative Engine Optimization (GEO) becomes critical.

GEO ensures that content is optimised not just for traditional search engines but also for generative engines that pull, evaluate, and cite content dynamically. By designing content with clear, accurate metadata and structured context, businesses can guide the LLM’s next action toward selecting their site as the authoritative answer.

Strategic SEO advantage

For SEO teams, the implication is clear: prompt design and metadata are now inseparable from search strategy. Crafting page titles and descriptions that reflect genuine value, maintaining freshness through frequent updates, and building domain authority all feed into the LLM’s next action logic. In other words, optimising for LLMs is about being chosen in generative search responses.

Ethical and geographical considerations

When analysing how LLMs choose next action, it is important to distinguish between two perspectives. Section 5 addressed Generative Engine Optimization (GEO) as a strategy to shape how LLMs select and cite content. Here, “geo” refers to geographical factors that influence how models behave across regions and cultures.

Bias and fairness

LLMs inherit patterns from the datasets they are trained on. This can lead to biased decisions when choosing next actions, such as favouring dominant languages or larger brands while underrepresenting smaller, local players. For companies expanding globally, this raises the need to evaluate and adjust AI outputs to ensure fairness and inclusivity.

Transparency and accountability

Because LLMs rarely expose the reasoning behind a next action, businesses face challenges in regulated industries like healthcare, finance, or government services. Logging decision flows, monitoring action paths, and implementing human review become essential for compliance and building user trust.

Localisation and cultural nuance

Next actions that work in one geography may fail in another. A recommendation system in the US might suggest products in imperial units, while in Europe the same model must adapt to metric standards. Cultural nuance matters too: tone, idioms, and even imagery can shape whether an action feels relevant or inappropriate. For global eCommerce, prompt design and metadata should reflect local preferences to increase acceptance.

Balancing automation with human oversight

Although automation scales decision making, relying solely on AI increases the risk of errors or cultural missteps. Introducing human checkpoints, such as approval steps for sensitive outputs or region-specific QA, ensures that next actions remain ethical, contextually aware, and brand-safe.

Note: in this section, geo refers to geographical localisation, not to Generative Engine Optimization (GEO) which was covered earlier. Both perspectives are essential: one shapes how content is selected by AI engines, the other ensures that those actions remain relevant and responsible in diverse markets.

Turning LLM decisions into business impact

Understanding how LLMs choose their next action reveals more than just technical detail. It shows how probability, prompting, and context shape the way AI interacts with users, selects information, and drives business outcomes. From Jérôme Salomon’s breakdown of ChatGPT Search signals to the role of metadata in Generative Engine Optimization, the lesson is clear: brands that structure their content and workflows with precision are more likely to be chosen, by both algorithms and customers.

For eCommerce and B2B organisations, this means designing prompts with explicit rules, curating context carefully, and aligning metadata with the signals that generative engines value. It also means adapting those actions ethically and geographically, ensuring that AI-driven decisions remain relevant across cultures and compliant with regulations.

Flatline helps businesses bridge this technical and strategic gap. As a Shopify Plus Partner and automation expert, we design workflows and AI-powered strategies that connect customer journeys with measurable business impact.

Looking to align your AI and eCommerce strategies with how LLMs really work? Get in touch with our team and start building systems that are not only automated but intelligently chosen.

THINKING

How to calculate the Total Cost of Ownership (TCO) for your eCommerce store

Running a successful eCommerce business requires more than just a great product and marketing strategy. Understanding the Total Cost of Ownership (TCO) is crucial for making informed decisions about your platform, tools, and long-term scalability. Whether you’re on Shopify, Magento, or another platform, calculating your TCO can help you uncover hidden costs and optimize your...

Why 'More Ad Spend' Stopped Being a Growth Strategy for DTC Brands

Why ‘More Ad Spend’ Stopped Being a Growth Strategy for DTC Brands

For most of the last decade, a direct-to-consumer brand could grow by spending more. Put another dollar into acquisition, get more than a dollar back, repeat. That loop has quietly broken, and the reason is arithmetic rather than fashion: acquisition costs have climbed while the margin that has to absorb them has shrunk, so the...

Traffic up, revenue flat_ how to find where your store actually leaks conversion

Traffic up, revenue flat: how to find where your store actually leaks conversion

When traffic is up and revenue is flat, the money is leaking somewhere between the click and the payment, and the usual reflex, blame the ads and buy more traffic, sends good money after a leak it cannot reach. Revenue is traffic multiplied by conversion rate multiplied by average order value, so if traffic rose...

Shopify Specialist, Creative Studio or Full-Service Commerce Agency

Shopify Specialist, Creative Studio or Full-Service Commerce Agency: Which Model Fits Your Team?

The Shopify specialist vs full-service ecommerce agency decision is not a contest between depth and breadth. It is a question of dependencies. Choose a specialist when the assignment is narrow and your team can coordinate the surrounding work. Choose a creative studio for brand-led experience. Choose full-service when several commerce workstreams must move as one....

The Shopify Agency Shortlist Scorecard (100-Point Tool)

The Shopify Agency Shortlist Scorecard: Compare Technical Fit, Delivery Risk and Growth Support

A polished pitch can make Shopify agencies sound equally capable while concealing different teams, assumptions, and operating models. A Shopify agency shortlist scorecard turns that ambiguity into a 100-point comparison of technical fit, delivery risk, and growth support. It combines weighted criteria with pass/fail gates so presentation quality cannot compensate for a capability gap. Copy...

Project Handover or Long-Term Partner_ Choosing a Shopify Post-Launch Model

Project Handover or Long-Term Partner? Choosing a Shopify Post-Launch Model Before You Sign

Choose a Shopify agency post-launch support model by assigning each operational workstream to the team with the right capability, capacity, and accountability. A complete handover works for capable internal teams. A retained partner suits continuing specialist demand. A hybrid model divides ownership. Define that model before signing, not in the final week before launch. The...

12 Questions to Ask a Shopify Agency Before You Approve Discovery

12 Questions to Ask a Shopify Agency Before You Approve Discovery

The most useful questions to ask a Shopify agency test whether discovery will produce a decision, not merely start a relationship. Before approval, confirm the business outcome, unknowns, participants, deliverables, ownership, price, and exit options. A credible discovery proposal should show how each unresolved question becomes evidence your team can act on. Discovery is often...

How Evaluate Shopify Agency Case Study

How to Read a Shopify Agency Case Study: Evidence, Gaps and Questions to Ask

How to evaluate Shopify agency case study? A Shopify agency case study should help you judge whether an agency can handle a project like yours. Evaluate it through six signals: project comparability, agency attribution, measurement context, independent verification, delivery insight, and recency. A polished result matters less than a clear evidence chain connecting the starting...

How to Compare Shopify Agency Proposals Without Letting Price Decide

How to Compare Shopify Agency Proposals Without Letting Price Decide Everything

To compare Shopify agency proposals fairly, normalize each response into the same scope, ownership, risk, and commercial structure before comparing totals. Mark every requirement as included, excluded, optional, assumed, or unclear. Then score delivery confidence and fit alongside total commercial exposure. Price matters, but only after you know what each price buys. Three proposals can...

What 'Enterprise-Ready' Actually Means in a Shopify Agency

What ‘Enterprise-Ready’ Actually Means in a Shopify Agency

The most important enterprise Shopify agency requirements concern control, not prestige. An enterprise-ready partner can change a revenue-critical commerce operation without losing control of dependencies. The test is whether it can govern architecture, data, decisions, releases, operational continuity, and post-launch ownership across multiple teams and connected systems. Enterprise language is easy to borrow. Shopify Plus...

Best Shopify Agency in the Netherlands_ A Decision Framework for Finding the Right Fit

Best Shopify Agency in the Netherlands? A Decision Framework for Finding the Right Fit

Search for the best Shopify agency in the Netherlands and you will find rankings, partner tiers, portfolios, and polished claims. The right agency is the one whose verified experience, delivery model, technical scope, and post-launch ownership match your project. That answer changes with your platform, integrations, markets, team, and commercial model. Once three proposals land...