Search
30 results for “llm”
Search results
LLM Evaluation & Reducing Hallucinations
Why "it feels better" isn't a shippable justification for a prompt change, what an LLM-graded eval actually measures, and why explicitly allowing "I don't know" is one of the most effective, cheapest hallucination fixes available.
LLM Fundamentals: Tokens, Context Windows & Sampling
Why a token isn't a word, what actually happens when a request would exceed the context window, and what temperature and top_p each control during generation.
What is an "LLM-graded" eval, and when would you reach for it instead of exact-match or similarity-based grading?
An LLM-graded eval uses a separate model call to judge a subjective quality of the output, tone, empathy, professionalism, on a numeric scale or binary classification, rather than checking it against one fixed correct answer. Exact-match grading only works when there's one right answer (a category label); similarity-based grading (cosine similarity between embeddings) works when wording can vary but meaning should match a reference. LLM-graded evals are the right tool specifically for qualities that are inherently subjective and hard to define with a fixed rule or reference string, at the cost of being noisier and more expensive to run than a simple string comparison.
Prompt Engineering
Why a role set in the system prompt shapes every response differently than the same instruction in a user message, and why 3-5 well-chosen examples reliably steer output format better than more instructions alone.
Why does a word count poorly estimate how many tokens a prompt will use?
A token is a commonly-occurring sequence of characters the model was trained on, not a word, common short words are often a single token, while a longer or less common word can split into several tokens ("tokenization" might become " token" plus "ization"). As a rough rule of thumb, one token is about 4 characters or 0.75 words in English, but that ratio shifts with vocabulary, punctuation, and especially non-English text, so a word count is only ever an approximation, not the actual unit the model's context window and pricing are measured in.
A request's input already exceeds the model's context window before generation even starts. What happens, versus a request that only exceeds the limit once output is generated?
If the input alone already exceeds the context window, the API rejects the request upfront with a 400 error, generation never starts at all. If the input fits but input tokens plus the requested max output tokens could exceed the window, current models accept the request and generate as far as they can; if generation actually reaches the window limit before finishing, it stops early with a specific stop reason indicating the context window was exhausted, rather than silently truncating or erroring out mid-response. The distinction matters operationally: the first case is a fixable request-construction bug, the second is a signal to reduce the requested output length or the accumulated conversation history.
What is the practical difference between lowering temperature and lowering top_p, and why would you use them together?
Temperature scales the randomness applied across the entire probability distribution of next-token candidates, low temperature makes the model consistently pick its highest-probability tokens, high temperature flattens the distribution so lower-probability tokens get chosen more often. top_p (nucleus sampling) instead restricts the candidate pool itself to the smallest set of tokens whose cumulative probability reaches the given threshold, then samples only from that trimmed set. They're complementary, not redundant: temperature changes how sharply the model prefers likely tokens, top_p changes which tokens are even eligible to be picked, which is why both are typically left at sensible defaults and only tuned together deliberately for advanced use cases, not adjusted independently without understanding the interaction.
What does putting an instruction in the system prompt actually change versus putting the same instruction in the first user message?
A system prompt sets standing context and role for the entire conversation, "you are a helpful coding assistant specializing in Python," and that framing persists and shapes tone and behavior across every subsequent turn without needing to be repeated. The same sentence placed in a user message is treated as part of the conversational exchange itself, mixed in with whatever else that turn asks for, rather than as a persistent behavioral frame the model treats as instruction-level context throughout the session. Even a single well-chosen sentence in the system prompt measurably changes tone and focus, which is why role-setting belongs there rather than being re-stated per turn.
Why does official prompting guidance recommend 3-5 examples specifically, and what makes an example actually useful versus counterproductive?
Few-shot (multishot) examples are one of the most reliable levers for steering output format, tone, and structure, and guidance specifically recommends 3-5 well-chosen examples for best results, few enough to stay practical, enough to establish a real pattern rather than one potentially misleading instance. What makes an example useful is being relevant (mirroring the actual use case closely), diverse (covering edge cases so the model doesn't latch onto an incidental, unintended pattern from too-similar examples), and structured (wrapped in clear tags so the model can distinguish example content from the surrounding instructions). A single example, or several near-duplicate ones, risks teaching an accidental pattern instead of the intended one.
What problem does wrapping different parts of a prompt in XML-style tags actually solve?
A complex prompt often mixes several genuinely different kinds of content in one block of text, instructions, background context, few-shot examples, and the actual variable input to process, and a model has to infer where one ends and the next begins from phrasing alone if nothing marks the boundaries. Wrapping each kind of content in its own consistently-named tag, `<instructions>`, `<context>`, `<example>`, `<input>`, removes that inference step entirely: the structure itself tells the model unambiguously what role each piece of text plays, which reduces misinterpretation especially as a prompt grows longer or nests multiple documents or examples.
AI Engineer Roadmap
From LLM fundamentals and prompt engineering through embeddings, retrieval-augmented generation, tool use, and evaluation, the core path for building real LLM-powered applications, linked into Cloud Tech by Victor topic references.
Linux Logging & Monitoring with journald
Why journald's default "auto" storage mode can quietly discard logs across a reboot on a fresh system, and how journalctl's unit and priority filters actually narrow down a live incident.
Linux Storage & LVM
How physical volumes, volume groups, and logical volumes let LVM pool multiple disks and resize storage without repartitioning, and what mount and /etc/fstab actually do to attach a filesystem to the directory tree.
What is the difference between a metric alert and a log alert in Azure Monitor?
A metric alert evaluates near-real-time numeric metrics (CPU percentage, request count) against a threshold, with low latency, typically triggering within a minute or so of the threshold being crossed. A log alert runs a KQL query against Log Analytics on a schedule (e.g., every 5 minutes) and alerts based on the query's results, which supports much richer conditions (joining multiple data sources, complex filtering) but has higher latency, bounded by both the query schedule and log ingestion delay. Choose metric alerts for fast-reacting, simple threshold conditions, and log alerts for anything requiring more complex logic than a single metric can express.
Why does an O(n log n) sort beat an O(n^2) sort for large inputs, even if the O(n^2) one is faster on small inputs?
Constant factors can make an O(n^2) algorithm faster for small n, Big O only describes the asymptotic trend, not the exact runtime. But growth rates diverge fast: at n = 1,000,000, n log n is about 20 million operations while n^2 is a trillion. Past a crossover point the asymptotically better algorithm always wins, which is why production sort implementations (like Timsort) still often special-case small arrays with a simpler O(n^2) sort under the hood.
What does the principle of least privilege mean in practice, and why is it hard to maintain over time?
Least privilege means granting an identity only the specific permissions it needs to do its job, nothing broader "to be safe" or "to save time." It's hard to maintain because permissions tend to accumulate, someone gets a broad role to unblock a one-time task and it's never revoked, or a service starts with wildcard permissions during initial development and nobody narrows them before shipping. Maintaining least privilege requires ongoing review (access audits, unused-permission detection), not just a careful initial setup, because the natural drift over time is always toward more access, not less.
A query filters WHERE logdate >= 2008-01-01 against a table range-partitioned by logdate across dozens of monthly partitions. What does partition pruning actually do, and what does it depend on?
Partition pruning lets the planner prove, from the query's WHERE clause and each partition's declared bounds, that some partitions cannot possibly contain a matching row, and it excludes them from the plan entirely rather than scanning and filtering every partition. In this example, `logdate >= 2008-01-01` has no upper bound, so it prunes only the partitions entirely before 2008-01, decades of older monthly partitions are eliminated before execution, while every partition from 2008-01 onward, including all of them up to the present, is still considered and scanned. Pruning down to a single partition would need a bounded predicate on both ends, for example `logdate >= 2008-01-01 AND logdate < 2008-02-01`. This depends entirely on the partition bounds themselves, not on any index, a partitioned table with no indexes at all still benefits from pruning, and pruning specifically requires the WHERE clause to reference the partition key directly with values (or parameters) the planner can actually compare against those bounds.
What do the three digits in a chmod octal mode like 644 or 755 actually mean, and what does a leading fourth digit add?
Each of the three digits is a sum of read (4), write (2), and execute (1), in order for the owner, the group, and everyone else; 644 means the owner gets read+write (4+2), while group and others get read-only (4). 755 means the owner gets read+write+execute (4+2+1), and group/others get read+execute (4+1), the common mode for an executable or a directory that others need to traverse. An optional leading fourth digit sets setuid (4), setgid (2), and the sticky bit (1); setuid/setgid make a program run with its owner's or group's privileges rather than the caller's, and the sticky bit on a directory (classically 1777 on /tmp) restricts file deletion to each file's own owner even though the directory itself is world-writable.
During a live incident, what does journalctl -f -u myservice -p err do, and why combine those specific options?
`-f` follows the journal in real time, printing new entries as they're appended, `-u myservice` scopes that stream to just the one unit under investigation, and `-p err` filters to only entries at the "err" priority or more severe (more important), suppressing informational noise. Combined, this gives a live, scoped, severity-filtered view of exactly one service's serious problems as they happen, rather than watching an unfiltered firehose of every unit's routine log output and trying to manually spot the relevant failure.
What does "at-least-once delivery" actually guarantee, and what does it not guarantee, and why does that mean a consumer must be idempotent?
At-least-once delivery guarantees a message will eventually be delivered and processed at least one time, it does not guarantee exactly one delivery, the same message can legitimately be delivered and processed more than once, for example if a consumer's deletion request is lost after it already finished processing, or a visibility timeout expires just as processing completes. Because duplicate delivery is a normal, expected outcome of this model rather than a rare edge case, a consumer has to be written so that processing the same message twice produces the same end result as processing it once (an idempotent operation), rather than assuming the queue itself will prevent duplicates.
What is the practical difference between a list and a tuple, beyond mutability?
The most visible difference is that lists are mutable (items can be added, removed, or changed after creation) and tuples are immutable (fixed once created). That immutability has real consequences: tuples can be used as dictionary keys or set members because they're hashable, while lists cannot. Tuples also communicate intent, a fixed-size, heterogeneous grouping (like a coordinate pair) is usually a better fit for a tuple, while a variable-length, homogeneous collection is usually a better fit for a list, independent of whether mutation is actually needed.
What is the difference between requirements.txt and a lockfile, and why does it matter for reproducibility?
A typical `requirements.txt` often specifies loose version ranges (`requests>=2.28`), which means two installs at different times can resolve to different actual versions as new releases come out, not truly reproducible. A lockfile (like `poetry.lock` or `uv.lock`) pins the exact resolved version of every dependency and transitive dependency, so installing from it produces the identical dependency tree every time, on any machine. The distinction matters because a subtle bug caused by a transitive dependency's patch version can be nearly impossible to reproduce without a lockfile guaranteeing everyone has the exact same versions.
Why does Python's sort achieve O(n) in the best case rather than always costing O(n log n) like a textbook mergesort?
Python uses Timsort, which specifically looks for and exploits "runs," contiguous stretches of already-ordered (or reverse-ordered) elements already present in the input, merging those runs rather than treating the data as uniformly random. Fully-sorted input is the extreme case of this: it's already one giant run, so Timsort recognizes it and finishes in linear time instead of doing the full comparison work a naive O(n log n) sort would perform regardless of input order. This is exactly why Timsort performs so well on real-world data, which is very often partially sorted already, not uniformly random.
An O(n^2) sort can be faster than an O(n log n) sort for small inputs. Why, and why doesn't that matter for a general-purpose sort function?
Big O describes asymptotic growth, not actual runtime, and O(n^2) algorithms often have smaller constant factors and simpler inner loops (no recursion or merge-buffer overhead) that make them genuinely faster in wall-clock time for small n, even though the more sophisticated O(n log n) algorithm would eventually win as n grows. This is exactly why production sort implementations, including Timsort, special-case small subarrays with a simple insertion sort internally rather than using the full merge-sort machinery on tiny inputs, getting the best of both regimes instead of picking one algorithm for every input size.
MongoDB can be configured to behave more like a CP system or more like an AP system. What settings make that choice, and what are they actually trading?
Write concern and read preference are the actual levers: a write concern requiring acknowledgment from a majority of replicas favors consistency, a write isn't considered successful until enough nodes agree, at the cost of availability if too many nodes are unreachable during a partition. A looser write concern, or reading from secondaries that might lag behind the primary, favors availability, operations keep succeeding even when full replica agreement isn't achievable, at the cost of potentially reading or acknowledging data that isn't fully consistent across the cluster yet. This is exactly the CP-versus-AP trade-off CAP describes, expressed as a concrete, tunable configuration rather than an abstract theorem.
What do LCP, INP, and CLS each measure, and why are all three needed instead of one overall "speed" number?
LCP (Largest Contentful Paint) measures loading performance, specifically how quickly the largest visible element renders, "good" is 2.5 seconds or less. INP (Interaction to Next Paint) measures interactivity/responsiveness, the delay between a user interaction and the browser's next visual response, "good" is 200 milliseconds or less. CLS (Cumulative Layout Shift) measures visual stability, how much content unexpectedly shifts around during the page's lifecycle, "good" is a score of 0.1 or less. A single overall number couldn't distinguish a page that loads fast but jumps around from one that's stable but slow to interact with, three separate metrics are needed because loading, interactivity, and stability are genuinely different failure modes.
A page has a fast average LCP but users still frequently report the page feeling slow. What could the percentile-based measurement reveal that an average wouldn't?
If a substantial slice of real page loads, say the slowest 25%, badly miss the 2.5 second LCP threshold (a slow connection, a busy device, a cold cache), the average can still look fine because it's dominated by the faster majority, while a real, sizable group of users are having a genuinely bad experience the average is actively hiding. Checking the 75th-percentile value directly (rather than the mean) surfaces that gap: if the 75th percentile is well above 2.5 seconds even though the average looks fine, that's a concrete signal that meaningful numbers of real users are missing the threshold, not a false alarm.
Mastering Nano, Vim & NeoVim on Linux: From Beginner Editing to Pro-Level Terminal Workflows
Nano vs Vim vs Neovim: Which Linux Text Editor Should Engineers Actually Use?
Linux Beginner Labs: Foundations (Understand Linux, Not Just Commands)
This lab helps you understand how Linux works internally, not just type commands. By the end of these labs, Linux will feel logical, not intimidating. Before You Start The Lab (Very Important). What You Need You can use any Linux environment : Ubuntu Desktop / Server Linux VM Cloud VM WSL (Windows…
Linux Foundations (Beginner): How Linux Really Works - Not Just Commands
Most beginners learn Linux backwards.