Urgent.News

What's breaking now, across thousands of outlets.

AI

Stop Using LLMs Like Search Engines

Most devs use modern language models wrong. They open a chat window, paste an error stack trace, and wait for a magic snippet. When it works, they celebrate. When the model hallucinates a nonexistent method on a standard library class, they complain that AI is overhyped. The core mistake is treating an LLM like a deterministic search engine or a junior dev who actually knows your codebase. It is…

Many developers misuse modern language models in their work. They copy-paste an error stack trace into a chat window, hoping for a perfect solution. When the model correctly generates a snippet, developers are delighted. But when the model hallucinates an invalid method from a standard library class, engineers become critical of AI being overhyped.

The fundamental problem is treating an LLM like a deterministic search engine or a junior developer who actually understands your codebase. It is neither. Instead, an LLM is a spatial compressor of human text, arranging tokens in multi-dimensional vector spaces. If you give it vague prompts, you'll receive average code. To achieve high-quality results, you should approach the interaction like an API design problem.

Take, for example, an LLM trying to write a complex database migration or an asynchronous worker loop from scratch. Such tasks are prone to disaster, as the model samples from common patterns on the public internet, which often include deprecated libraries, unhandled race conditions, and missing error boundaries. To avoid this, flip the workflow.

Use the model as a strict transformation engine. Provide it your exact architectural constraints, data types, and failure modes as explicit parameters. For instance, when you need a robust parser, don't just ask for one. Instead, supply the grammar rules and the expected failure states. The key thought is that you're not asking the model to think.

You're asking it to interpolate between boundaries you've defined. Currently, many engineers treat the model like a general-purpose chat interface. However, the future lies in building domain-specific wrappers that incorporate your team's internal documentation, SDK versions, and linting rules into the context window before the model processes the prompt.

If your developers continue to copy-paste code snippets from a browser-based chat window, you're sacrificing productivity. Instead, treat prompt engineering like systems programming. Build the harness, define the types, and let the inference engine perform the heavy lifting within safe, controlled environments.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

Stop Telling Your AI What Format You Want. Start Writing It.

You ask the model for a JSON object. Your parser gets this: Certainly! Here's the JSON you asked for: {"severity": "high", "summary": "Login fails after password reset"} Let me know if you'd like me…

  • Seed desired format directly into model's response to avoid extraneous phrases.
  • Utilize API features like structured output or JSON mode for better control.
  • Implement validation to ensure generated output conforms to specified format.

Semantic Caching and Live Internet Search: Tools That Let AI Cache Answers to Save Money, and Pull Data From the Web When It Needs To

Say you open the logs of your chat system and they are full of questions like these: "How do I change my password?" "Forgot my password, what do I do?" "Where do I reset my password?" All three mean…

  • Semantic caching saves costs by remembering answers to similar questions.
  • Live internet search provides real-time data when needed.
  • Two methods work together with a sorting step to determine appropriate approach.

More from Friday 30 October →