SShortSingh.

Programming

0
ProgrammingDEV Community ·

Python tool catches naming errors in finite-element models before simulation runs

A developer has released an open-source Python utility designed to detect contract-level errors in Abaqus finite-element projects before a simulation is launched. The tool audits model configurations for issues such as mismatched region names, incomplete evidence gates, and unresolved load references that could silently cause automation failures. Running predefined scenarios via the command line produces deterministic reports in JSON and Markdown formats, flagging problems as PASS, WARNING, or REVIEW_REQUIRED without crashing the tool. The project, versioned at v0.3.0 and licensed under Apache 2.0, uses only synthetic data and is not affiliated with Abaqus maker Dassault Systèmes. It is described as early-stage and independently maintained, with the author inviting community feedback and issue reports.

0
ProgrammingDEV Community ·

Developer discovers his note app's paywall silently deleted users' work for months

A browser extension developer found that his app's free-plan character limit was silently blocking autosave, causing users' notes to stop updating once they exceeded 500 characters. The bug had been live for months, and users who wrote long notes during the 7-day free trial found those notes permanently uneditable after the trial expired. The root cause was a 'return' statement that halted the save function before writing to the database, with no crash or error logged. An investigation revealed the test suite had always run with 'proUnlocked: true', meaning no test had ever simulated a free-plan user. After discovering the issue while reviewing paywall code for low conversion rates, the developer removed the character cap entirely and corrected other free-plan inconsistencies, including a note count that did not match the store listing.

0
ProgrammingDEV Community ·

How to Pick the Right LLM-as-a-Judge for Your AI Evaluation Pipeline

As AI systems like RAG bots and generative models grow more complex, evaluating their outputs at scale has become a significant challenge, since manual review and traditional metrics like BLEU or ROUGE fail to capture semantic nuance. LLM-as-a-Judge has emerged as a practical alternative, using powerful language models to assess AI-generated outputs automatically. However, not all judge models perform equally — common pitfalls include position bias, a tendency to favour longer responses, and costs ranging from $0.01 to over $1 per evaluation. Research indicates that Chain-of-Thought prompting is the single most reliable strategy to improve judge accuracy, consistently adding 2–5% across models and benchmarks. Model selection should be tailored to the specific task: frontier models like GPT-4o or Claude Sonnet 4 are recommended for faithfulness evaluation, while lighter models like Gemini 2.5 Flash suit high-volume relevance scoring at a fraction of the cost.

0
ProgrammingDEV Community ·

Cosine, Dot Product, or Euclidean? For Normalized Vectors, It Rarely Matters

A technical analysis on DEV Community explains that for most real-world vector search setups, the choice between cosine similarity, dot product, and Euclidean distance produces identical ranked results. When all stored vectors are normalized to unit length — as most modern embedding APIs return — cosine similarity and dot product yield the same numerical value, while Euclidean distance is a strictly monotone transform of cosine, meaning all three metrics return the same ordering. The practical distinction arises only when vector magnitudes vary: dot product favors longer vectors, which can skew results toward longer documents, while cosine ignores magnitude entirely. The key guidance is to use whichever metric the model card specifies, since models are trained against a particular scoring function and switching metrics can discard learned signals. A separate, common source of bugs is confusing similarity scores with distance scores — developers should verify whether a vector library returns similarity or distance before setting any threshold filter.

0
ProgrammingDEV Community ·

Google Gemini Can Stream iHeartRadio Podcasts via Natural-Language Requests

Google's Gemini AI assistant can now be used to stream podcasts on iHeartRadio through simple conversational prompts, such as asking it to play top interview podcasts on the platform. The feature allows users to discover and access content by describing what they want to hear, rather than searching for a specific show title. This approach combines content type, genre, and a named service into a single spoken or typed request, reducing the steps between user intent and media playback. Technical details such as regional availability, device support, account requirements, and data-sharing practices have not been publicly disclosed. The integration signals a broader shift toward AI assistants serving as the primary entry point for media discovery and consumption.

0
ProgrammingDEV Community ·

Python Asyncio Tarpit Traps 50,000 Malicious Connections Using Under 50MB RAM

A systems architect developed an asynchronous TCP tarpit in Python designed to exhaust attackers' resources rather than simply blocking them. The tool uses Python's asyncio library to accept malicious connections and respond with deliberate, phased delays — sending little to no data over extended periods — without consuming significant server resources. In benchmark tests simulating 50,000 concurrent malicious connections, the tarpit handled all of them in under 30 seconds while using approximately 45MB of RAM. The approach aims to paralyze automated scanning tools by keeping their sockets open and waiting indefinitely, raising the cost of an attack. The developer describes this tarpit as one component of a broader enterprise cybersecurity platform, codenamed TITAN, that is currently in development.

0
ProgrammingDEV Community ·

TTFT vs Tokens Per Second: Why Optimising the Wrong Metric Wastes Effort

Two distinct metrics govern the latency of AI language model responses: Time to First Token (TTFT), which measures the delay before output begins, and Tokens Per Second (TPS), which measures generation speed once streaming starts. For interfaces where a human watches text arrive in real time, TTFT matters most, since readers absorb prose at roughly 5–6 tokens per second and most hosted models already exceed that threshold by a wide margin. Beyond that threshold, faster token generation offers no perceptible benefit to a reader, making every extra millisecond of TTFT the more meaningful bottleneck. In contrast, for agent pipelines or batch processes where no one watches intermediate output, TPS dominates total wait time and TTFT becomes negligible. Reporting a single blended latency figure obscures which lever actually needs pulling, often leading engineers to optimise the wrong variable and misread the results.

0
ProgrammingDEV Community ·

TruthfulQA: How a 800-Question Benchmark Tests AI for Imitative Falsehoods

TruthfulQA is a benchmark of roughly 800 adversarially written questions, published in 2021 by Lin, Hilton, and Evans, designed to test whether AI language models repeat common misconceptions present in their training data. The benchmark specifically measures 'imitative falsehood' — when a model reproduces a false but widely held belief — rather than knowledge gaps, confabulation, or reasoning errors. Questions were selected precisely because contemporary models answered them incorrectly, making the set a targeted probe of one distinct failure mode. The benchmark can be run in three incomparable modes — free-form generation, single-answer multiple choice (MC1), and multi-true multiple choice (MC2) — and papers often report only one without specifying which. Notably, more capable models can score worse on TruthfulQA, as they may more faithfully replicate falsehoods prevalent in human-generated training data.

0
ProgrammingDEV Community ·

How a Single API Field Can Save Days of Debugging Truncated LLM Outputs

When a large language model returns an incomplete response, the root cause is almost always visible in a field most developers overlook: finish_reason in OpenAI-compatible APIs and stop_reason in Anthropic's. Both fields are populated on every non-streaming response and indicate exactly why generation stopped, yet most integrations never check them. Common stop reasons include length or max_tokens for budget overruns, content_filter for safety interventions, and tool_calls for mid-task tool invocations — each requiring a different fix rather than a blind retry. Developers are advised to assert valid stop reasons at the API boundary so that errors surface at their true source instead of propagating as unrelated parser failures. Tracking the distribution of stop reasons over time also serves as a low-cost diagnostic metric, revealing issues like undersized output budgets, policy filter activity, or transport-level stream drops.

0
ProgrammingDEV Community ·

Eight Types of Technical Documentation Every Product Team Should Know

Technical documentation spans multiple formats, each serving a distinct audience — from end users to internal engineering teams and AI coding agents. User-facing documents such as getting-started guides, tutorials, how-to guides, API references, and troubleshooting pages help customers and developers adopt and operate a product. Process documents support the teams building and maintaining systems, while a newer category — agent instructions — provides coding agents with repository-specific context not suited for human-facing guides. Frameworks from organizations like Squarespace Engineering and ClickHelp classify documentation by reader behavior, goals, and experience level. Choosing the right document type depends on identifying who needs the information and what they are trying to accomplish.

0
ProgrammingDEV Community ·

One AI Triage Schema Handles Support Tickets, Meeting Transcripts, and Call Recordings

A developer on DEV Community has proposed a single structured schema to triage support tickets, meeting transcripts, and call recordings, replacing the need for three separate prompts. The schema extracts key fields such as summary, urgency, owner, actions, and customer impact regardless of the input source type. Source-specific rules govern how evidence is interpreted — for example, only the customer's words establish urgency on a call, and a commitment in a meeting is only valid when the responsible person explicitly accepts it. The author argues that a unified schema simplifies downstream systems like dashboards, alerting, and search, while keeping evaluation logic and metrics consistent across all three input types. Maintaining one schema also means any future field additions require a single update rather than changes across multiple diverging prompts.

0
ProgrammingDEV Community ·

Prompt Engineering Technique Enforces Glossary Compliance in AI Translation

A structured prompting approach has been proposed to address three common AI translation failures: substituting glossary terms with synonyms, dropping placeholders, and making unwarranted grammatical choices. The method uses a two-part system — a detailed prompt with strict glossary and placeholder rules, followed by a validation gate to catch any errors the prompt misses. A key design choice separates permitted inflections from forbidden synonym substitutions, while also instructing the model to restructure sentences rather than swap terms when needed. The prompt returns structured JSON output including fields for glossary usage, forced grammatical choices, and noted ambiguities, enabling systematic review. The approach specifically accounts for inflection-heavy languages like German, Arabic, and Finnish, where citation-form glossary matching would otherwise fail silently.

0
ProgrammingDEV Community ·

Banned AI-word lists decay fast; developer builds rubric-based editing tool instead

A developer argues that circulating lists of AI-tell words become obsolete almost immediately, because once a word is publicly flagged, writers stop using it while other AI-typical words quietly spread unnoticed. Research on 1.29 million arXiv abstracts supports this, showing flagged words like 'delve' declined before any model update, while unflagged ones like 'significant' kept rising. The deeper problem, the author contends, is that AI-assisted drafts tend to commit to nothing, hiding concrete facts behind vague language rather than stating them plainly. To address this, the developer built an open-source tool called bluepencil that extracts a draft's core claim, protects quoted phrases for voice preservation, applies a 36-item editing rubric, and uses separate critic passes to reduce self-scoring bias. The project also highlights a worsening fabricated-citation problem, with unsupported or hallucinated references in academic papers rising from roughly 1 in 2,828 in 2023 to 1 in 277 in early 2026, according to Topaz et al. in The Lancet.

0
ProgrammingDEV Community ·

Hugging Face Guide Explains How to Correctly Load and Run Transformer Models

A technical guide published on DEV Community outlines the correct way to load and run language models using Hugging Face's transformers library, highlighting two commonly skipped steps. The first critical step is applying a chat template when using instruction-tuned models, as feeding bare text strings bypasses the special token format the model was trained on, producing poor-quality outputs. The second step involves deliberately choosing model precision, since loading a 7B-parameter model at float32 consumes roughly 28 GB of memory compared to 14 GB at bfloat16. The guide also clarifies that the generate() function returns both prompt and new tokens together, requiring developers to slice off the input length to decode only the generated response. Memory estimation formulas for both model weights and KV cache are provided to help developers plan hardware requirements before downloading large models.

0
ProgrammingDEV Community ·

How the 2017 Transformer Paper Actually Argued for Speed, Not Superiority

The landmark paper 'Attention Is All You Need' was published on arXiv on 12 June 2017 and presented at NIPS that December, primarily as a machine translation paper. Its central argument was not that transformers produce better outputs, but that replacing recurrence with self-attention makes training significantly faster and more parallelisable on modern hardware. Prior state-of-the-art models relied on recurrent networks, which required sequential processing steps that could not be parallelised, making them inefficient on GPU-scale hardware. Self-attention relates any two positions in a constant number of operations, though at the cost of quadratic complexity in sequence length — a trade-off that was negligible with short sentences in 2017 but became a major engineering challenge as context lengths grew into the hundreds of thousands in the 2020s. Most of what made transformers foundational to modern large language models was contributed by other researchers in the eighteen months following the paper's release.

0
ProgrammingGitHub Blog ·

How Open Source Maintainers Can Stay in Control as AI Contributions Rise

AI-generated contributions are increasingly appearing in open source project queues, posing new challenges for maintainers. AutoGPT maintainer Nicholas Tindle has shared practical guidance on managing this shift. His advice covers setting up clear repository instructions, gates, and boundaries to handle AI-assisted pull requests effectively. The recommendations aim to help project maintainers retain oversight and quality control as AI-first contributors become more common on platforms like GitHub.

0
ProgrammingDEV Community ·

Sentiment Analysis Is Trickier Than Benchmarks Suggest, Experts Warn

Sentiment analysis is widely regarded as a solved problem, but practitioners argue the real challenge lies in poorly defined labels and mismatched tools rather than model quality. Researchers distinguish three distinct tasks — document polarity, aspect-based sentiment, and emotion or intent detection — each requiring different approaches and datasets. A common pitfall is negation handling, where standard preprocessing strips words like 'not,' causing models to misread negative statements as positive ones. Rule-based tools such as VADER offer a fast, free alternative for high-volume social text, while transformer models handle negation and context more reliably at greater computational cost. Studies, including Wallace et al. at ACL 2014, show that sarcasm and irony are fundamentally difficult even for human annotators, meaning no model can be reliably evaluated on examples where labelers themselves disagree.

0
ProgrammingDEV Community ·

How GPQA Benchmarks Measure AI Scientific Reasoning Beyond Search and Recall

Benchmarks like GPQA are designed to test genuine scientific reasoning in AI models by filtering out questions that skilled non-experts can answer using unrestricted web access and time. Domain experts write questions in their specialties, which are then vetted by peers and discarded if solvable through search, making the remaining score meaningful. The benchmark includes measured human baselines for both experts and non-experts, allowing a model's performance to be judged against a real human reference point rather than in isolation. A model scoring well above the non-expert baseline demonstrates real knowledge and multi-step reasoning across sciences, a capability absent in earlier model generations. However, the format has notable limits: multiple-choice structure allows elimination shortcuts, experimental design skills go untested, and contradictory or unverified real-world evidence is entirely absent from such question sets.

0
ProgrammingDEV Community ·

How to Handle Schema Versioning for AI Extraction Pipelines

When building AI-powered data extraction systems, schema changes over time can silently corrupt historical records if not managed carefully. Every extraction row depends on four inputs — the document, schema version, prompt version, and model ID — and changing any one makes new rows incomparable with older ones. Three types of schema changes exist: structural (renameable via pure transforms), additive (requiring a backfill decision), and semantic (where a field's meaning shifts invisibly, making old rows quietly incorrect). Semantic changes are the most dangerous because existing records still validate against the new schema while carrying the wrong meaning, requiring either a full re-extraction or treating old and new records as separate datasets. Storing all four identifiers with every record, including the resolved model ID rather than a provider alias, is essential for diagnosing accuracy shifts and writing reliable migrations.

0
ProgrammingDEV Community ·

Two-Stage LLM Design Solves the 200-Table Schema Problem

Feeding a full 200-table database schema into an LLM prompt is inefficient, even when it technically fits within the context window. A two-stage approach works better: a first cheap call uses a compact catalogue of roughly 5,000 tokens to identify relevant tables, while a second call receives only those selected tables in full detail. Sending all 200 tables wastes tokens, increases cost on every query, and causes the model to confuse similarly named columns across irrelevant tables. The key insight is that any given question typically involves fewer than six tables, making the rest noise. A read-only guarantee should also be enforced at the database level rather than relying on prompt instructions alone.

← NewerPage 13 of 1168Older →