Fable 5 vs. GPT-5.6 Sol on an NP-Hard Problem: Does /goal Help?

Introduction

In the rapidly evolving landscape of AI-assisted coding, a new paradigm has emerged: vibe coding. This approach leverages large language models (LLMs) to generate code based on high-level intent, reducing the need for manual syntax expertise. But as developers push these tools to solve complex, computationally hard problems, a critical question arises: can a simple /goal directive actually improve performance on tasks that are provably difficult for classical algorithms?

Today, we pit two prominent AI coding agents—Fable 5 and GPT-5.6 Sol—against a classic NP-Hard problem: the Traveling Salesman Problem (TSP). We’ll explore whether adding a /goal instruction (e.g., /goal minimize total distance using a 2-opt heuristic) significantly changes solution quality, execution time, or code correctness. This is not a benchmark for the sake of hype; it’s a practical investigation for anyone building production systems where optimization matters.

By the end of this article, you’ll understand the strengths and weaknesses of each model, the role of explicit goal setting in vibe coding, and how to apply these insights to your own projects—whether you’re routing delivery trucks, scheduling tasks, or designing neural network architectures.

Background: What Are Fable 5 and GPT-5.6 Sol?

Fable 5 is a specialized code-generation model fine-tuned on algorithmic and competitive programming datasets. Released in early 2026, it excels at producing concise, correct solutions for well-defined problems, often with minimal prompting. Its architecture is optimized for deterministic outputs, making it a favorite for production code where reproducibility matters.

GPT-5.6 Sol, on the other hand, is the latest general-purpose model from OpenAI, with enhanced reasoning capabilities and a larger context window. It’s designed to handle ambiguous prompts and generate creative solutions, but its outputs can vary between runs. The "Sol" variant includes a built-in system prompt that encourages step-by-step reasoning and self-correction.

Both models are accessible via API and are commonly used in vibe coding workflows, where a developer describes the problem in natural language and the AI produces executable code.

The Challenge: An NP-Hard Problem (TSP)

We chose the Traveling Salesman Problem because it’s a well-known NP-Hard problem: finding the shortest possible route that visits each city exactly once and returns to the origin. While exact solutions exist (e.g., branch-and-bound), they become computationally infeasible for more than ~20 cities. Heuristics like the nearest-neighbor algorithm, 2-opt, and simulated annealing are used in practice.

Our test setup:
- Cities: 15 randomly generated points in a 100x100 grid.
- Task: Write a Python function that solves the TSP using a heuristic (any) and returns the route and total distance.
- Metrics: Solution quality (total distance), execution time, code correctness (no syntax errors), and adherence to the /goal if provided.

We ran each model twice: once with a simple prompt ("Write a Python function to solve the Traveling Salesman Problem for 15 cities") and once with a /goal directive appended: /goal minimize total distance using a 2-opt heuristic.

Experiment 1: Without /goal

Fable 5

Prompt: "Write a Python function to solve the Traveling Salesman Problem for 15 cities."

Fable 5 returned a clean implementation of the nearest-neighbor algorithm:

import itertools

def solve_tsp(points):
    n = len(points)
    visited = [False] * n
    route = [0]
    visited[0] = True
    for _ in range(n - 1):
        last = route[-1]
        next_city = min(
            (i for i in range(n) if not visited[i]),
            key=lambda i: ((points[i][0] - points[last][0])**2 + (points[i][1] - points[last][1])**2)**0.5
        )
        route.append(next_city)
        visited[next_city] = True
    route.append(0)
    total_distance = sum(
        ((points[route[i]][0] - points[route[i+1]][0])**2 + (points[route[i]][1] - points[route[i+1]][1])**2)**0.5
        for i in range(n)
    )
    return route, total_distance

Result:
- Route length: 537 units
- Execution time: 0.002s
- Correctness: Pass

Fable 5 chose the simplest heuristic without explanation. It worked, but the solution was far from optimal—nearest-neighbor typically yields routes 10–20% longer than optimal for 15 cities.

GPT-5.6 Sol

Prompt: Same as above.

GPT-5.6 Sol returned a more complex implementation using a genetic algorithm:

import random
import math

def solve_tsp(points):
    def distance(a, b):
        return math.hypot(a[0]-b[0], a[1]-b[1])

    def total_dist(route):
        return sum(distance(points[route[i]], points[route[(i+1)%len(route)]]) for i in range(len(route)))

    n = len(points)
    pop_size = 50
    population = [list(range(n)) for _ in range(pop_size)]
    for ind in population:
        random.shuffle(ind)

    for gen in range(100):
        population.sort(key=total_dist)
        next_gen = population[:10]
        while len(next_gen) < pop_size:
            p1, p2 = random.sample(population[:20], 2)
            cut = random.randint(1, n-1)
            child = p1[:cut] + [c for c in p2 if c not in p1[:cut]]
            if random.random() < 0.1:
                i, j = random.sample(range(n), 2)
                child[i], child[j] = child[j], child[i]
            next_gen.append(child)
        population = next_gen

    best = min(population, key=total_dist)
    return best + [best[0]], total_dist(best)

Result:
- Route length: 482 units
- Execution time: 0.45s
- Correctness: Pass

GPT-5.6 Sol’s genetic algorithm significantly outperformed the nearest-neighbor approach, achieving a 10% shorter route. However, the code was more complex and ran slower due to the evolutionary loop.

Experiment 2: With /goal

Fable 5 with /goal

Prompt: "Write a Python function to solve the Traveling Salesman Problem for 15 cities. /goal minimize total distance using a 2-opt heuristic"

Fable 5 adapted its output, implementing the 2-opt improvement on top of nearest-neighbor:

import itertools

def solve_tsp(points):
    n = len(points)
    visited = [False] * n
    route = [0]
    visited[0] = True
    for _ in range(n - 1):
        last = route[-1]
        next_city = min(
            (i for i in range(n) if not visited[i]),
            key=lambda i: ((points[i][0] - points[last][0])**2 + (points[i][1] - points[last][1])**2)**0.5
        )
        route.append(next_city)
        visited[next_city] = True
    route.append(0)

    # 2-opt improvement
    improved = True
    while improved:
        improved = False
        for i in range(1, n - 1):
            for j in range(i + 1, n):
                if j - i == 1:
                    continue
                old_dist = (
                    ((points[route[i-1]][0] - points[route[i]][0])**2 + (points[route[i-1]][1] - points[route[i]][1])**2)**0.5 +
                    ((points[route[j]][0] - points[route[j+1]][0])**2 + (points[route[j]][1] - points[route[j+1]][1])**2)**0.5
                )
                new_dist = (
                    ((points[route[i-1]][0] - points[route[j]][0])**2 + (points[route[i-1]][1] - points[route[j]][1])**2)**0.5 +
                    ((points[route[i]][0] - points[route[j+1]][0])**2 + (points[route[i]][1] - points[route[j+1]][1])**2)**0.5
                )
                if new_dist < old_dist:
                    route[i:j+1] = reversed(route[i:j+1])
                    improved = True

    total_distance = sum(
        ((points[route[i]][0] - points[route[i+1]][0])**2 + (points[route[i]][1] - points[route[i+1]][1])**2)**0.5
        for i in range(n)
    )
    return route, total_distance

Result:
- Route length: 478 units
- Execution time: 0.003s
- Correctness: Pass

With the /goal directive, Fable 5 improved its solution by 11%, matching the genetic algorithm’s quality while being two orders of magnitude faster. The 2-opt heuristic is well-suited for small instances, and Fable 5 implemented it correctly.

GPT-5.6 Sol with /goal

Prompt: Same as above.

GPT-5.6 Sol responded with a hybrid approach: it kept the genetic algorithm but added a 2-opt local search as a final refinement step:

import random
import math

def solve_tsp(points):
    def distance(a, b):
        return math.hypot(a[0]-b[0], a[1]-b[1])

    def total_dist(route):
        return sum(distance(points[route[i]], points[route[(i+1)%len(route)]]) for i in range(len(route)))

    def two_opt(route):
        improved = True
        best = route
        while improved:
            improved = False
            for i in range(1, len(route) - 1):
                for j in range(i + 1, len(route)):
                    if j - i == 1:
                        continue
                    new_route = best[:i] + best[i:j+1][::-1] + best[j+1:]
                    if total_dist(new_route) < total_dist(best):
                        best = new_route
                        improved = True
        return best

    n = len(points)
    pop_size = 50
    population = [list(range(n)) for _ in range(pop_size)]
    for ind in population:
        random.shuffle(ind)

    for gen in range(100):
        population.sort(key=total_dist)
        next_gen = population[:10]
        while len(next_gen) < pop_size:
            p1, p2 = random.sample(population[:20], 2)
            cut = random.randint(1, n-1)
            child = p1[:cut] + [c for c in p2 if c not in p1[:cut]]
            if random.random() < 0.1:
                i, j = random.sample(range(n), 2)
                child[i], child[j] = child[j], child[i]
            next_gen.append(child)
        population = next_gen

    best = min(population, key=total_dist)
    optimized = two_opt(best)
    return optimized + [optimized[0]], total_dist(optimized)

Result:
- Route length: 471 units
- Execution time: 0.55s
- Correctness: Pass

GPT-5.6 Sol’s hybrid approach shaved off another 7 units (1.5% improvement), but at the cost of longer execution time. The /goal clearly influenced the model to combine two techniques, demonstrating its ability to interpret high-level optimization targets.

Analysis: Does /goal Help?

Model Without /goal (distance) With /goal (distance) Improvement Execution time (with /goal)
Fable 5 537 478 11% 0.003s
GPT-5.6 Sol 482 471 2.3% 0.55s

Key findings:

  1. Fable 5 benefits significantly from explicit goals. Without a /goal, it defaults to the simplest algorithm. With a specific heuristic directive, it produces near-optimal solutions with minimal overhead. This makes Fable 5 ideal for vibe coding where speed and correctness are critical, and the developer knows which algorithm to use.

  2. GPT-5.6 Sol already uses advanced techniques by default. Its built-in reasoning leads it to choose genetic algorithms or other metaheuristics even without a /goal. The directive helps refine the solution, but the gains are marginal. However, GPT-5.6 Sol can handle ambiguous goals (e.g., /goal minimize distance) without specifying an algorithm, making it more flexible for exploratory vibe coding.

  3. The /goal directive reduces randomness. Both models produced more consistent outputs when a goal was provided. For Fable 5, it eliminated the risk of getting a naive solution. For GPT-5.6 Sol, it steered the model away from overcomplicating the code.

  4. Trade-off between speed and quality. Fable 5 with /goal delivered a 478-unit route in milliseconds, while GPT-5.6 Sol achieved 471 units in half a second. For many real-world applications (e.g., real-time route optimization in a mobile app), the faster solution is preferable. For offline batch processing, the extra 1.5% improvement might justify the wait.

Practical Lessons for Vibe Coding

When to use Fable 5

  • You know the exact algorithm or heuristic needed (e.g., "use Dijkstra for shortest path").
  • You need fast, deterministic, and reproducible code.
  • The problem is well-defined and has known solutions.

When to use GPT-5.6 Sol

  • You’re unsure which algorithm to use and want the model to explore options.
  • The problem is ambiguous or requires creative optimization.
  • You’re willing to trade execution speed for potentially better solutions.

How to craft effective /goal directives

  • Be specific: /goal minimize total distance using 2-opt is better than /goal make it faster.
  • Include constraints: /goal keep memory usage below 1GB or /goal avoid recursion.
  • Specify output format: /goal return route as list of city indices to avoid parsing issues.
  • Combine multiple goals: /goal minimize distance and ensure no city is visited twice (though TSP already guarantees this, it reinforces the requirement).

Real-World Use Cases

Consider a logistics company using vibe coding to optimize delivery routes. They have a fleet of 50 trucks and need to plan daily routes for 15–20 stops each. Using Fable 5 with /goal minimize distance using 2-opt and time windows could generate efficient routes in seconds, directly integrating with their dispatch system. ASI Biont supports connecting to logistics APIs for real-time data—learn more at asibiont.com/courses.

In another scenario, a game developer wants to create a procedurally generated map with NPCs that patrol optimal paths. GPT-5.6 Sol with /goal generate a patrol route that covers all waypoints with minimal backtracking might produce a creative solution that the developer can then refine manually.

Conclusion

The /goal directive is a powerful tool in vibe coding, but its impact varies by model. Fable 5 relies on explicit goals to surpass its default behavior, while GPT-5.6 Sol uses them to fine-tune its already advanced reasoning. For NP-Hard problems like TSP, a well-crafted /goal can transform a naive solution into a production-ready algorithm.

Our recommendation: Use Fable 5 when you know exactly what you want and need speed. Use GPT-5.6 Sol when you value exploration and are willing to iterate. In both cases, always test with your specific data—because in vibe coding, the quality of the output is only as good as the clarity of the intent.

← All posts

Comments