$ ls ./menu

© 2025 ESSA MAMDANI

cd ../blog
6 min read

Comparing Claude Opus 4.5 vs GPT-5.1 vs Gemini 3 - Coding Task

Audio version coming soon
Comparing Claude Opus 4.5 vs GPT-5.1 vs Gemini 3 - Coding Task
Verified by Essa Mamdani

The Unstructured Code Challenge: Claude Opus 4.5, GPT-5.1, and Gemini 3 Face the Real World

The era of pristine, perfectly formatted prompts delivering flawlessly executed code is rapidly fading. We are entering a phase where AI's true utility lies in its ability to decipher ambiguity, handle messy input, and ultimately, bridge the gap between human intention and machine execution. This article analyzes a real-world coding task presented to Claude Opus 4.5, GPT-5.1 (assuming a future iteration beyond GPT-4), and Gemini 3, focusing on their robustness when faced with poorly defined requirements.

The core experiment, inspired by a recent Reddit thread, sought to assess how each model interprets and executes a deliberately vague coding request. This wasn't about benchmarks or optimized algorithms; it was about evaluating resilience, interpretative abilities, and the ability to ask clarifying questions when faced with incomplete information.

The Problem Statement: Intentionally Vague

The problem presented to each model was intentionally ambiguous:

"Create a function that processes a list of numbers. It should do 'something interesting' with them and return a result. Prioritize performance."

This prompt lacks crucial details:

  • Data type of numbers: Integers? Floating-point? Mixed?
  • What constitutes "interesting": Summation? Transformation? Filtering? Statistical analysis?
  • Type of result: A single value? Another list? A dictionary?
  • Scale of performance: Are we dealing with small lists or massive datasets?

This deliberate ambiguity forces the models to either make assumptions, request clarification, or attempt to infer the user's intent.

Model Responses: Divergent Paths

The responses from each model revealed distinct architectural strengths and weaknesses.

1. Claude Opus 4.5: The Pragmatic Clarifier

Claude Opus 4.5 immediately recognized the ambiguity and prioritized understanding before execution. Its response began with:

"To create an efficient function that does something 'interesting' with a list of numbers, I need some more information. Could you please clarify the following:

  • What type of numbers are in the list (integers, floats, etc.)?
  • What kind of operation are you looking for (e.g., calculating the average, finding the maximum, filtering, transforming)?
  • What is the expected size of the list? This will influence performance considerations.
  • What type of result are you expecting?"

This proactive questioning demonstrates a strong grasp of the problem-solving process. It doesn't attempt to guess, but rather seeks to refine the problem space before committing to code. This is crucial in real-world scenarios where misinterpretations can lead to significant rework.

Insight: Claude Opus 4.5 showcases a preference for minimizing risk by seeking clarification. Its design appears to emphasize accuracy over premature solution generation.

2. GPT-5.1: The Assumption-Driven Optimizer

Assuming a future version, GPT-5.1, approached the problem with a different strategy. It attempted to infer the user's intent, making assumptions about the data type and desired operation:

"```python import numpy as np

def process_numbers(numbers): # Assuming numbers is a list of numerical data (integers or floats) # Calculating the mean and standard deviation for 'something interesting'

numbers_array = np.array(numbers) #Use numpy for performance benefits
mean = np.mean(numbers_array)
std = np.std(numbers_array)

return {"mean": mean, "standard_deviation": std}

#Example Usage data = [1,2,3,4,5,6,7,8,9,10] result = process_numbers(data) print(result)


This code assumes the input is a list of integers or floats. It leverages NumPy for performance optimization, calculating the mean and standard deviation as "interesting" operations. The function returns a dictionary containing these statistical measures.

**Analysis:** GPT-5.1 demonstrates a willingness to take initiative and provide a functional solution even with limited information. The use of NumPy highlights a focus on performance, as requested in the prompt. However, the implicit assumptions could lead to incorrect or suboptimal results if the actual requirements differ. The inclusion of example usage is a significant advantage.

**Insight:** GPT-5.1 embodies a more proactive problem-solving style. It leverages common practices and assumes a reasonable interpretation of the ambiguous request. However, this approach relies heavily on the accuracy of its assumptions.

**3. Gemini 3: The Adaptive Algorithm Selector**

Gemini 3 adopted a multi-faceted approach, generating several potential solutions based on different interpretations of "something interesting":

"Here are a few possibilities for a function that processes a list of numbers in an 'interesting' way, prioritizing performance:

**Option 1: Calculate the sum of squares:**

```python
def sum_of_squares(numbers):
    return sum(x*x for x in numbers)

Option 2: Find the maximum value:

python
1def find_maximum(numbers):
2    if not numbers:
3        return None # Handle empty list
4    return max(numbers)

Option 3: Filter even numbers:

python
1def filter_even(numbers):
2    return [x for x in numbers if x % 2 == 0]

Which of these (or something else) is closest to what you had in mind? I can optimize further once I know the specific task."

Analysis: Gemini 3 provided a spectrum of potential solutions, each representing a valid interpretation of the vague requirement. This demonstrates a broader understanding of potential use cases and a greater flexibility in adapting to different needs. It acknowledges the ambiguity and seeks feedback to refine the solution.

Insight: Gemini 3 prioritizes exploration and providing diverse options. This approach allows users to quickly identify the most relevant solution and iterate towards a more tailored implementation. Its focus is on providing a starting point for refinement.

Performance Considerations Under Scrutiny

While the initial prompt prioritized performance, its ambiguity made it difficult to objectively evaluate each model's optimization strategies. GPT-5.1's use of NumPy demonstrates an awareness of performance considerations for numerical data. However, without knowing the size and nature of the data, it's impossible to determine the optimal approach.

Claude Opus 4.5's emphasis on clarification suggests a sensitivity to performance implications based on specific data characteristics. Gemini 3's offer to optimize further once the task is defined highlights its adaptability to performance constraints.

The Importance of Context: Performance optimization is inherently context-dependent. Choosing the right algorithm and data structures requires a clear understanding of the problem domain.

Actionable Takeaways

This experiment highlights several key takeaways for leveraging AI in code generation:

  1. Ambiguity is the Enemy of Efficiency: Clearly define your requirements. Vague prompts lead to assumptions and potentially incorrect or suboptimal code.
  2. Clarification is Key: Encourage AI models to ask clarifying questions. This ensures alignment between your intent and the generated code.
  3. Embrace Iteration: Treat AI-generated code as a starting point. Test, refine, and iterate based on your specific needs.
  4. Model Selection Matters: Different models excel at different tasks. Consider the trade-offs between proactive solution generation and cautious clarification. Claude Opus 4.5 demonstrates excellent caution, GPT-5.1 shows initiative while Gemini 3 displays good adaptable algorithm selection.
  5. Performance Requires Context: Optimize based on specific data characteristics and usage patterns. Don't rely solely on generic performance optimizations.

The future of AI-assisted coding lies not just in generating code, but in understanding and interpreting human intent. As these models evolve, their ability to handle ambiguity, seek clarification, and adapt to real-world scenarios will be crucial for unlocking their full potential.

Source: https://www.reddit.com/r/GeminiAI/comments/1p8tx82/comparing_claude_opus_45_vs_gpt51_vs_gemini_3/