As I consume AI NLP responses I very often accept without much resistance, second guessing, or contemplation for or against the result presented to me. I simply read it and if I agree, I take it as true and continue forward with my activity. If I don’t agree I tend to respond with my doubt about the output, resulting in an NLP response more aligned with mine. One does not know what one doesn’t know and it isn’t what you know that hurts you, it’s what you know that isn’t so. Agreeing with those 2 statements, I often wonder how those who have less, apposing, or conflicting experiences respond and react to seemingly incorrect LLM NLP inference output. Does one simply accept the output as fact and move on with that ‘truth’? What is and what is not correct or true has a lot to do with context, and sometimes there is no ‘is’ and ‘is not’ there is instead the choice is which path has the greatest probability of a positive outcome and poses the least amount of risk to do harm.
That may or may not be the exact definition of a hallucination but by any means, the output from AI interface is not what is expected, considered ‘made up’ or not. So we strive to remove as much bias, ambiguity, and complexity from our prompts, without so much instruction, because perhaps too much instruction would result in generating the answer we want instead of the truth. Forking is a method which separates a complex prompt into more distinct reasoning paths so that deeper exploration can be performed in each context instead of binding them all together into a single inference. It is the expectation that by doing so, a more true outcome can be achieved. Here is a simple example of a prompt which would benefit from forking.
user_prompt = (
"Should I buy a Fender Stratocaster or a Gibson Les Paul "
"as my primary guitar?"
)
That is a good example for forking because it is a multi-dimensional question and no single ‘true’ answer exists. Most LLMs are designed to produce a balanced response and in the provided example, the LLM will attempt to infer this simultaneously. The output would most likely not produce the desired output of choosing one over the other. The output for that prompt would be something like the following, which is not an answer, rather a balanced, non biased response.
The Fender Stratocaster is known for its versatility, comfort, and bright tones. The Gibson Les Paul is known for its sustain, powerful humbucker sound, and strong presence in rock music. Choose a Stratocaster if you play a wide variety of styles and value flexibility. Choose a Les Paul if you prefer classic rock tones and rich sustain.
The information is helpful but there is no answer to it. Consider instead of configuring multiple Agents with specific instructions, then have a final Agent which synthesizes the responses, for example.
- strat_prompt
- les_paul_prompt
- budget_prompt
- risk_prompt
- synthesizer_prompt
strat_prompt
strat_prompt = f"""You are a guitar expert who strongly favors the
Fender Stratocaster. Analyze the Fender Stratocaster as a primary
guitar.
Focus on: Strengths, Versatility, Playability, Tone options,
Genres where it excels
Question: {user_request} """
les_paul_prompt
les_paul_prompt = f"""You are a guitar expert who strongly favors
the Gibson Les Paul. Analyze the Gibson Les Paul as a primary
guitar.
Focus on: Strengths, Sustain, Build quality, Tone, Genres where
it excels
Question: {user_request}"""
budget_prompt
budget_prompt = f"""You are a practical guitar-buying advisor.
Compare the Fender Stratocaster and Gibson Les Paul from
the perspective of: Purchase cost, Maintenance, Resale value,
Long-term ownership.
Question: {user_request}"""
risk_prompt
risk_prompt = f"""You are a guitar instructor. Identify risks and
potential buyer's remorse situations associated with both guitars.
Focus on: Comfort, Learning curve, Genre mismatch, Common
misconceptions. Question: {user_request}"""
The source code to fork and execute these Agents in parallel is shown here in Listing 1.
Listing 1, forking and running multi-agents in parallel
from openai import OpenAI
import asyncio
client = OpenAI()
async def run_agent(prompt: str):
response = client.responses.create(
model="gpt-4.1",
input=prompt
)
return response.output_text
strat_result, les_paul_result, budget_result,
risk_result = (
await asyncio.gather(
run_agent(strat_prompt),
run_agent(les_paul_prompt),
run_agent(budget_prompt),
run_agent(risk_prompt)
)
)
synthesizer_prompt
synthesizer_prompt = f"""You are a guitar purchase reviewer. You
have received analyses from four specialist agents.
---------------------------
STRATOCASTER ANALYSIS
---------------------------
{strat_result}
---------------------------
LES PAUL ANALYSIS
---------------------------
{les_paul_result}
---------------------------
BUDGET ANALYSIS
---------------------------
{budget_result}
---------------------------
RISK ANALYSIS
---------------------------
{risk_result}
Perform the following:
1. Summarize key findings from each agent.
2. Identify areas of agreement.
3. Identify conflicting viewpoints.
4. Highlight major tradeoffs.
5. Create a decision matrix."""
Listing 2 illustrates how to infer the synthesizer to provide the most desirable guitar.
Listing 2, synthesizing forked Agents
final_review = client.responses.create(
model="gpt-4.1",
input=synthesizer_prompt
)
print(final_review.output_text)
The output of the synthesized is as follows, but also consider that part of the synthesizer_prompt you can change it to simply provide the guitar name like Fender Stratocaster or Gibson Les Paul without all the reasoning text. Doing so means you can use it as a value to execute further code based on the result.
After reviewing the specialist analyses, the Fender Stratocaster emerges as the stronger choice for a primary guitar. While the Gibson Les Paul offers exceptional sustain and classic rock tones, the Stratocaster provides greater versatility, lower ownership costs, broader genre coverage, and fewer beginner-related risks. Areas of Agreement: - Both guitars are professional-quality instruments. - Both can serve as a primary guitar. Key Tradeoffs: - Les Paul offers better sustain. - Stratocaster offers better versatility and comfort. Recommendation: For a guitarist seeking one instrument to cover practice, recording, and live performance across multiple genres, the Fender Stratocaster is the recommended choice.
This is really a hard one to call because they are very different guitars and have pros and cons for given context. However, when you ask for an answer to your question, you might not always get the answer you want. If that is the case you can change the prompt until you get the answer you want or fine-tune the model to achieve the same.
I personally could not answer this question as I love them both.
Here is a nice article with more information about this.