So, GPT-5 Is Tripping Over Code. Here's Why & What to Do About It.
Z
Zack Saadioui
8/13/2025
So, GPT-5 Is Tripping Over Code. Here's Why & What to Do About It.
The tech world was buzzing. GPT-5 was finally here. The next leap forward in artificial intelligence, promising to be smarter, faster, & more capable than ever. For developers, the dream of a true AI coding partner, one that could not just write snippets but understand & refactor complex codebases, seemed within reach.
But then, the reports started trickling in. And honestly, they've been a bit of a mixed bag. While some users are finding it incredibly powerful for certain tasks, a growing chorus of developers are reporting that when it comes to the nitty-gritty of code editing, GPT-5 is... well, struggling. We're hearing about it failing programming tests that its predecessor, GPT-4o, aced. It's apparently generating broken scripts, making bizarre choices, & sometimes just outright ignoring instructions. There's even a new "Edit" button that sounds great in theory but has been described as "futile."
It’s frustrating, to say the least. You have this incredibly powerful tool, but it feels like you're fighting it as much as you're working with it. So, what’s going on? Is GPT-5 a dud? Not exactly. The thing is, the problems we're seeing with GPT-5 aren't entirely new. They're amplified versions of the same fundamental challenges that have been lurking under the surface of large language models (LLMs) for a while now.
Turns out, writing & editing code is a REALLY hard problem for AI. It’s not like writing an email or a blog post. Code is a delicate dance of logic, syntax, & context. And that’s where things get tricky for our new AI overlords. Let's dig into why this is happening & then, more importantly, what we can actually do about it.
The "Why": Unpacking the Glitches in the Matrix
It's tempting to just throw our hands up & go back to the old ways. But if we understand why these models are failing, we can learn to work with them more effectively. It’s less about the tool being broken & more about us needing a new kind of user manual.
1. The "Ancient History" Problem: Outdated Training Data
Here's a core issue: LLMs are trained on a snapshot of the internet at a particular point in time. Think of it like a textbook that was printed a year or two ago. For many subjects, that’s fine. But in the fast-paced world of software development, a year is an eternity. Libraries get updated, new frameworks emerge, & best practices evolve.
So, you might ask GPT-5 to write a script using the latest version of a popular library, but it might generate code based on an older, deprecated version. It’s not being lazy; it’s just working with the knowledge it has. This can lead to code that’s inefficient, insecure, or just plain doesn't work with your current environment. It also means the model might not be aware of newer, more efficient APIs or functions, leading it to generate slower or more verbose code.
2. The Illusion of Understanding: Syntax vs. Semantics
This is a big one. LLMs are masters of syntax. They've analyzed billions of lines of code, so they know what correct code looks like. They can generate functions, classes, & loops that are syntactically perfect. But here's the catch: they don't truly understand the logic or the "why" behind the code.
This is the difference between knowing the grammar of a language & actually being able to write a compelling story. The model can produce code that runs without errors, but it might not do what you actually want it to do. It might miss the entire point of the problem, leading to logically flawed or inefficient algorithms that just look plausible. We're seeing this in reports where GPT-5 makes "absurd decisions," like adding a hundred lines of custom code to handle an edge case that a simple regex fix would have solved.
3. The Hallucination Engine: Making Stuff Up
You've probably heard about AI "hallucinations," & in the world of code, they can be particularly maddening. This is when an LLM, in its effort to be helpful, just invents things that don't exist. We've seen reports of GPT-5 creating fake properties for a programming language, confidently presenting an answer that is completely wrong.
This happens because the model is a pattern-matching machine. If it has seen a lot of code that follows a certain pattern, it might try to apply that pattern even when it doesn't fit, filling in the gaps with plausible-sounding but entirely fabricated code. For a junior developer who might not know any better, this can be a huge problem.
4. The Ghosts in the Machine: Security & Edge Cases
Because LLMs don't have a real-world understanding of how code is used, they're not great at thinking about the "what ifs." What if a user enters a negative number? What if a database connection fails? What if the input is in an unexpected format? These are the edge cases that human programmers learn to anticipate through experience.
LLMs, on the other hand, often miss these. They'll give you the "happy path" solution, the code that works when everything is perfect. But production code is rarely perfect. This is why AI-generated code can sometimes introduce subtle security vulnerabilities or cause outages. It’s not malicious, but it’s a blind spot that we need to be aware of.
5. The Unpredictability Factor: Why You Can't Get the Same Answer Twice
One of the most frustrating things about working with LLMs is their non-deterministic nature. You can give the same prompt to the model twice & get two different answers. This can be a nightmare for debugging & for creating reproducible results. It's also why you might find the model giving you a great answer one minute & a terrible one the next.
This is partly by design. A little bit of randomness helps the model be more creative. But when you're trying to fix a specific bug, creativity is the last thing you want. You want precision & consistency.
The Workaround Guide: How to Actually Get Stuff Done
Okay, so it’s not all sunshine & roses. But that doesn't mean we should abandon these tools. It just means we need to get smarter about how we use them. Think of GPT-5 not as an autonomous coder, but as an incredibly powerful, sometimes erratic, junior developer. Your job is to be the senior dev, guiding it, checking its work, & providing the context it lacks.
1. Become a Master of the Prompt
This is, without a doubt, the most important skill for working with any LLM. The quality of the output is directly proportional to the quality of your input. "Garbage in, garbage out" has never been more true.
Provide Context: Don't just paste a function & say "fix it." Explain what the function is supposed to do, what the error is, & what you've already tried. The more context you provide, the better. One study on developer interactions with LLMs found that a key reason for failure was missing information in the prompts.
Be Specific: Instead of "make this code better," try "refactor this loop into a more efficient list comprehension to improve readability." The more specific your instruction, the less room for the model to go off the rails.
Give Examples: If you want the output in a specific format, give it an example. If you're trying to fix a bug, provide the error message. Show, don't just tell.
Iterate, Don't Argue: If you don't get the right answer the first time, don't just keep re-prompting with the same thing. Try rephrasing your request, adding more context, or breaking the problem down. Sometimes, starting a new chat can help, as long-running conversations can cause the model to get confused.
2. Break It Down: The Power of Small Steps
Instead of asking the model to write an entire application in one go, break the problem down into smaller, more manageable chunks. Ask it to write a single function. Then, ask it to write the tests for that function. Then, ask it to refactor it.
This approach has a few advantages. First, it makes it easier to provide context for each specific task. Second, it makes it easier to spot errors in the generated code. And third, it forces you to think through the problem logically, which is always a good thing.
3. The Human-in-the-Loop is Non-Negotiable
The dream of an AI that writes perfect, production-ready code without human intervention is still just that: a dream. For the foreseeable future, we are the most important part of the equation. We are the quality filter.
Review Everything: Never, ever, trust AI-generated code without thoroughly reviewing it. Read it, understand it, & question it. Does it handle edge cases? Is it secure? Is it efficient?
Test, Test, Test: Your existing testing workflow is more important than ever. Write unit tests, integration tests, & end-to-end tests to validate the behavior of the AI-generated code.
You're the Senior Dev: Remember, the AI is your junior partner. It's your job to catch its mistakes, teach it the right way to do things (through better prompts), & ultimately take responsibility for the code that gets shipped.
4. Build Your Own Expert: The Case for Custom AI
Here’s where things get REALLY interesting. One of the biggest problems we've talked about is context. GPT-5 doesn't know your specific codebase, your company's coding standards, or your internal APIs. But what if it could?
This is where platforms like Arsturn come into play. Here's the thing: instead of relying on a general-purpose model that knows a little bit about everything, you can use a tool like Arsturn to build your own custom AI chatbot trained on your data. Imagine feeding an AI your entire codebase, your technical documentation, & your internal developer wikis.
Suddenly, you have a coding assistant that actually understands your world. You could ask it questions like:
"What's the correct way to handle authentication in our new microservice?"
"Can you show me an example of how to use our internal
1
BillingAPI
?"
"What are the coding standards for writing React components at this company?"
This is a game-changer. Instead of getting generic advice, you get tailored, context-aware answers that are actually useful. It's like having a senior developer on call 24/7, ready to answer your questions. For businesses, this is huge. Arsturn helps businesses create these custom AI chatbots that can provide instant support not just to customers, but to internal teams like developers, dramatically speeding up development cycles & reducing the time spent searching for information. It’s a way to leverage the power of AI while mitigating the problems caused by a lack of specific knowledge.
5. The Fine-Tuning Frontier
Related to the idea of custom AI is the concept of fine-tuning. Research has shown that fine-tuning open-source code models on specific datasets of code editing tasks can significantly improve their capabilities, closing the gap between them & their closed-source counterparts.
This is a more advanced technique, but it points to a future where we're not just using massive, one-size-fits-all models. Instead, we'll be using smaller, more specialized models that are experts in a particular domain, whether it's a specific programming language, a framework, or even a single company's codebase.
The Road Ahead: It's a Marathon, Not a Sprint
It's easy to get caught up in the hype & the backlash. GPT-5 is amazing. GPT-5 is terrible. The truth, as always, is somewhere in the middle. These tools are still in their infancy, & we're all still learning how to use them effectively. The issues we're seeing now are not signs of failure, but rather growing pains. They are highlighting the immense complexity of software development & the areas where we need better tools & better techniques.
The future of AI in coding probably doesn't look like a single, all-powerful model that does everything for us. It looks more like a collection of specialized tools, custom-built assistants, & a new way of working where the human developer is more of an architect & a quality controller than a simple bricklayer.
So, if you're struggling with GPT-5, don't despair. Take a step back, understand the limitations, & adapt your workflow. Learn to be a great prompter. Break down your problems. And most importantly, never stop being the skeptical, curious, & rigorous engineer that you are. The robots aren't here to take your job; they're here to make it more interesting.
Hope this was helpful. Let me know what you think.