Why Large Language Models Still Struggle and How to Fix Them
Large language models still suffer from limited memory, constrained context windows, outdated knowledge, inability to control external systems, and poor domain expertise, but the article outlines two main remedies—fine‑tuning (Model‑as‑a‑Service) and prompt‑engineering—detailing their mechanisms, suitable scenarios, and trade‑offs.
1. Limitations of Large Language Models
Zero‑state memory – LLMs do not retain conversation state across multiple API calls, so earlier turns are forgotten.
Context‑window token limits – Early OpenAI models were limited to ~32 k tokens; newer models reach ~128 k tokens (roughly the size of a book). Many other models have far smaller windows, requiring careful budgeting to avoid truncation.
Static knowledge base – Pre‑training data is frozen at training time, so the model cannot incorporate real‑time information and may hallucinate when the training corpus is limited.
Limited external system control – Standard LLM APIs only return text. Plugins (e.g., ChatGPT plugins) provide a narrow set of standardized actions and are difficult to extend for custom workflows such as smart‑home or vehicle control.
Domain‑specific reliability – General‑purpose LLMs answer generic questions well but often fail on highly specialized queries because the required expertise is absent from the training data.
2. Mitigation Strategies
2.1 Fine‑tuning (Model‑as‑a‑Service)
Fine‑tuning injects proprietary domain data into a base LLM, updating its internal knowledge and improving performance on specialized tasks. The workflow typically involves:
Collecting a large, high‑quality domain dataset (e.g., manufacturing process logs, medical records).
Formatting the data into instruction‑response pairs.
Running a full‑scale fine‑tuning job on the provider’s platform or on‑premise infrastructure.
Deploying the resulting model as an API endpoint (Model‑as‑a‑Service, MaaS) for downstream applications.
Fine‑tuning effectively addresses domain knowledge gaps and knowledge‑base freshness, but it does not solve memory loss, context‑window constraints, or external system integration, and it can be costly due to compute and data‑privacy considerations.
2.2 Prompt Engineering
Prompt engineering leverages context‑aware prompts and vector‑based embeddings to guide an unmodified LLM toward accurate, domain‑specific answers without additional training. A typical pipeline includes:
Generate dense embeddings for each piece of domain material (documents, code, specifications) using a model such as text‑embedding‑ada‑002 or an open‑source encoder.
Store embeddings in a vector database (e.g., FAISS, Milvus, Pinecone).
At query time, embed the user question, retrieve the top‑k most relevant chunks, and concatenate them with a carefully crafted prompt template.
Send the assembled prompt to the LLM (e.g., OpenAI GPT‑4, open‑source ChatGLM) and return the model’s response.
This approach enables:
Real‑time perception of up‑to‑date information.
Integration with external services (e.g., printing, IoT) by embedding API calls in the prompt.
Effective memory augmentation by feeding retrieved context on each turn.
Extension of the usable context window through selective retrieval.
Prompt engineering works well with locally deployed open‑source models (e.g., ChatGLM‑6B) and orchestration frameworks such as LangChain , which provide utilities for embedding, retrieval, and prompt templating. The trade‑off is lower linguistic fluency compared with large proprietary models.
3. Practical Guidance
Choose fine‑tuning when you have:
Large volumes of proprietary domain data.
A need for a dedicated, always‑available model endpoint.
Choose prompt engineering when you have:
Limited data (e.g., a single technical book).
Requirements for rapid iteration, low cost, and direct integration with external systems.
In many projects a hybrid approach—using prompt engineering for most queries while reserving fine‑tuned models for critical, high‑precision tasks—yields the best balance of performance, cost, and flexibility.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
JavaEdge
First‑line development experience at multiple leading tech firms; now a software architect at a Shanghai state‑owned enterprise and founder of Programming Yanxuan. Nearly 300k followers online; expertise in distributed system design, AIGC application development, and quantitative finance investing.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
