SShortSingh.
Back to feed

Study Finds N-gram Count Tables Lack Memory Locality, Defying Earlier Assumption

0
·1 views

A software developer re-examined a core assumption in a series of language model experiments: that count tables used for next-token prediction would behave like mixture-of-experts models, keeping only a small 'hot set' of data resident in memory. To test this, the researcher rebuilt the tables as memory-mappable, pageable arrays and verified they produced identical accuracy results to the original in-memory versions. Measurements across eight real code files showed that working set memory kept growing throughout roughly 2,700 completion positions per file, with seven of eight files still expanding at the end of the session. A bounded cache test confirmed the problem, with hit rates plateauing at only 74.4% even when 16 MB was held resident, and dropping to 47.3% at 1 MB. The findings show that while code tokens repeat frequently, the count table is indexed by context rather than raw tokens, meaning locality at the token level does not translate into locality at the lookup level.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Password Length Matters More Than Complexity, Entropy Analysis Shows

A technical analysis published on DEV Community examines how password strength is measured using entropy, expressed in bits, which doubles the number of required guesses with each additional bit. Using an 88-character pool and an assumed offline attack rate of one trillion guesses per second, the study maps crack times across password lengths. An 8-character password yields around 51.7 bits of entropy and can be cracked in roughly 30 minutes, while a 12-character password jumps to 77.5 bits and would take approximately 3,400 years. The findings highlight a sharp security cliff between 8 and 12 characters, with length proving more impactful than adding special characters alone. The analysis concludes that randomly generated passwords significantly outperform human-chosen ones, regardless of complexity.

0
ProgrammingDEV Community ·

AI Advancement and Hiring Freezes Fuel Job Security Fears Among Software Engineers

A growing number of software engineers are expressing concern over job security as companies reduce hiring and layoffs become more frequent across the tech industry. Rapidly evolving AI models are increasingly capable of handling complex development tasks, raising questions about the long-term demand for human engineers. Career pivots into architecture, system design, or management are seen as temporary solutions, as AI is expected to eventually encroach on higher-level decision-making roles as well. Anthropic has cautioned that in a worst-case scenario, software engineers may need to transition into entirely different fields such as healthcare or skilled trades. The pace of AI advancement has left many experienced professionals, some with over a decade in the field, uncertain about the future value of their expertise.

0
ProgrammingDEV Community ·

How a Risk Score Gate Before Password and Email Changes Improves Account Security

A software engineer describes adding a step-up risk scoring system in Go to guard sensitive account mutations like password and email changes, after observing that standard session checks alone failed to prevent account takeovers. The approach involves assigning every security event an immutable correlation ID and feeding behavioral signals — such as failed login velocity and new device detection — into a risk service that returns a score and reasons without acting as an authenticator. Based on the score, the system routes requests through tiered verification challenges, from re-entering a current password at low risk to stronger factors or manual review at high risk. The author warns that thresholds set too tight increase false positives and prompt fatigue, while loose thresholds leave stolen sessions exploitable, so both outcomes are tracked under a defined SLO. The key design principle is placing the risk gate immediately before the state transition, not just at login, and treating the score as a policy-driven decision input rather than proof of identity.

0
ProgrammingDEV Community ·

Four DNS TXT Record Pitfalls That Break Domain Verification in FastAPI Onboarding

Verifying domain ownership via DNS TXT records is a common step in SaaS onboarding, but four failure modes cause most real-world problems. First, platforms that control a customer's subdomain can inadvertently verify their own zone, proving nothing about the customer's authority. Second, using email-based confirmation instead of TXT records only confirms mailbox access, not actual control over the domain's DNS zone. Third, negative DNS caching means a resolver may hold an NXDOMAIN response for hours after a customer correctly adds the required record, making the system appear broken. Properly handling these issues requires using the Public Suffix List to distinguish platform-controlled zones from customer-owned ones, and accounting for SOA-defined negative TTLs in retry logic.

Study Finds N-gram Count Tables Lack Memory Locality, Defying Earlier Assumption · ShortSingh