SShortSingh.

Programming

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.

0
ProgrammingDEV Community ·

Why JSON-LD Structured Data Is Invisible to Text Extractors and How to Stay Honest

Structured data using schema.org vocabulary can be expressed as JSON-LD, Microdata, or RDFa, with JSON-LD being the recommended format for most web pages. However, a key technical limitation means JSON-LD is stripped out by HTML-to-text extractors used in retrieval pipelines, since these tools remove script elements before processing page content. This makes JSON-LD invisible to text-based systems while remaining readable only to dedicated structured-data parsers. Because of this split, developers are advised to ensure every fact in structured markup is also present in the visible page text. A core honesty rule further requires that no value in structured data — such as ratings, prices, or FAQs — should represent information not actually shown to human readers on the page.

0
ProgrammingDEV Community ·

How to Manage Schema Changes in AI Pipelines Without Breaking Consumers

AI document pipelines typically involve three distinct schemas — source, internal, and index — that evolve independently, and conflating them is the root cause of most pipeline failures. The source schema is controlled by upstream systems and can change without notice, while the internal schema should be stable and source-agnostic, and the index schema should change conservatively to avoid costly rebuilds. Using a dedicated adapter per source as a 'shock absorber' between source and internal schemas ensures the rest of the pipeline remains insulated from upstream changes. Schema compatibility modes borrowed from streaming systems — BACKWARD, FORWARD, FULL, and their TRANSITIVE variants — provide a structured framework for safely deploying schema changes. AI pipelines in particular require FULL_TRANSITIVE compatibility because reprocessing historical data is a routine operation, meaning every schema version must remain mutually readable across all prior versions.

0
ProgrammingDEV Community ·

Why AI Labs Abandoned Chinchilla's Training Rule for Cheaper Inference

The 2022 Chinchilla paper by Hoffmann et al. established that model parameters and training tokens should scale together, with roughly 20 training tokens per parameter representing the compute-optimal ratio. This overturned earlier Kaplan et al. (2020) findings that favoured pouring more compute into larger, lightly-trained models, reframing that generation of AI as undertrained. However, a 2024 replication study by Besiroglu and colleagues found inconsistencies in Chinchilla's published coefficients, suggesting the precise 20-token ratio is softer than widely assumed, though the core qualitative finding holds. The deeper reason labs like Meta have since moved beyond Chinchilla's rule is economic: a deployed model incurs inference costs of roughly 2N FLOPs per generated token for its entire lifetime, making a smaller, heavily overtrained model far cheaper to serve at scale. Training a 7B model on 15 trillion tokens — as with Llama 3 — costs more upfront than compute-optimal but yields significant long-term savings compared to serving a much larger model.

0
ProgrammingDEV Community ·

Why Human vs. AI Sample Efficiency Comparisons Are Misleading

Debates over how much data AI models need compared to children hinge entirely on what researchers choose to count, making any single ratio more a reflection of methodology than reality. A child's learning input extends far beyond words to include objects, faces, actions, and causally structured experiences, meaning word-count comparisons capture only a fraction of human input. The comparison is further complicated by the lack of a fixed benchmark, since a child and a language model do not demonstrate competence in the same ways or on the same tasks. Whether evolutionary optimization should be counted as a form of pretraining for humans is a genuinely unresolved question that can shift the result by orders of magnitude. Researchers have identified at least five distinct ways to frame the comparison, each measuring a different quantity, and conflating them is the primary source of confusion in the field.

0
ProgrammingDEV Community ·

Google Gemini Integrates OpenTable to Book Restaurant Reservations via Chat

Google Gemini Apps has added direct integration with OpenTable, allowing users to search for restaurant availability and make reservations through plain-language requests. The feature supports checking availability, making new bookings, looking up existing reservations, and cancellations, though modifying a booking redirects users to the OpenTable app. It is currently limited to US residents aged 18 and older who are signed into a personal Google account with English as the supported language. The integration is accessible via both the Gemini mobile app and the web interface at gemini.google.com. Notably, Gemini cannot process payments, display menus, or show reviews within the reservation flow, making it a streamlined booking tool rather than a full replacement for OpenTable.

0
ProgrammingDEV Community ·

Meteor 3.5 introduces pluggable DDP transport with uWebSockets.js support

Meteor 3.5 replaces its long-standing, tightly integrated SockJS WebSocket transport with a pluggable architecture, allowing developers to swap transport implementations. SockJS remains the default, meaning existing applications are unaffected unless a change is explicitly requested. Developers can opt into uWebSockets.js — a high-performance C/C++ WebSocket server — by setting a single environment variable: DDP_TRANSPORT=uws. Switching to uWebSockets.js also eliminates the SockJS browser shim, enabling clients to connect via native WebSocket instead. The new transport registry is available in Meteor 3.5, which can be enabled for new or existing apps via the Meteor CLI.

0
ProgrammingDEV Community ·

The Real Cost of Deploying a Robot: Every Factor That Drives the Payback Formula

A detailed breakdown of industrial robot deployment costs reveals that the hardware purchase price is just one of over a dozen cost components, and rarely the largest. Key capital expenditures include tooling, fixturing, safety equipment, facility changes, and integration engineering — the last of which typically constitutes the single biggest line item. Ongoing costs such as downtime, software licensing, maintenance, and residual human supervision can significantly erode projected savings. A widely cited industry rule of thumb suggests total installed cost runs two to three times the arm price alone. The true payback period is calculated by dividing total CapEx by the net annual benefit, which must account for availability, utilization, and all recurring costs.

0
ProgrammingDEV Community ·

What Is XSS? How Cross-Site Scripting Attacks Work and How to Stop Them

Cross-site scripting (XSS) is a web security vulnerability that allows attackers to inject malicious code into trusted websites, where it executes inside visitors' browsers without their knowledge. The attack does not require server access — it exploits any site feature that displays user-submitted input, such as comment boxes or search fields, without properly sanitizing it first. XSS comes in three main forms: stored, reflected, and DOM-based, with stored XSS considered the most dangerous because a single malicious submission can affect every subsequent visitor to that page. Once executed, such scripts can steal session cookies, hijack admin accounts, inject fake payment forms, or redirect users to phishing pages. OWASP, the leading web security nonprofit, classifies XSS under its Top 10 critical risks, making it a priority concern for any site owner running forms or user-generated content.

0
ProgrammingDEV Community ·

How Random Forests Cut Variance: The Math Behind Bagging and Tree Averaging

Random forests reduce prediction variance by averaging many deep, unpruned decision trees, each trained on a different bootstrap sample of the data. Random feature selection at every split ensures trees remain diverse, preventing a single dominant feature from making all trees look alike. A mathematical identity shows that the mean squared error of an ensemble always equals the average individual tree error minus the spread among trees, explaining why diversity directly drives accuracy gains. Each tree leaves out roughly 37% of training rows, enabling out-of-bag error estimation as a free, honest validation method without a separate holdout set. Unlike boosting, adding more trees to a random forest converges to an error floor and cannot overfit, making the two methods fundamentally different in how they use depth, data, and sequential dependence.

0
ProgrammingHacker News ·

Grok 4.6 Scores 61 on Artificial Analysis Intelligence Index

xAI's Grok 4.6 has been evaluated on the Artificial Analysis Intelligence Index, achieving a score of 61. The benchmark results and analysis were published by Artificial Analysis, a platform that tracks and compares AI model performance. The score positions Grok 4.6 within the broader landscape of competing large language models. The release attracted discussion in the AI community, with the findings shared on Hacker News.

← NewerPage 65 of 1219Older →