The Mathematics of large language model (LLM) Optimization: How AI Readiness Is Scored
Most "AI readiness" tools are glorified checklists. They scan your site, flag a few issues, and hand you a number. But how is that number actually calculated? What separates a rigorous scoring methodology from a random number generator with a progress bar?
At Luna, we built a quantitative scoring engine grounded in weighted composite analysis — the same mathematical framework used in credit scoring, portfolio risk assessment, and medical diagnostic models. This post explains the methodology without revealing our proprietary weights.
The Core Formula
Every AI readiness score is fundamentally a weighted linear composite. The general form:
Where SGenerative Engine Optimization (GEO) is the composite score, λi is the weight assigned to variable i, φ is a bounded normalization function, ξi is the raw input signal, τi is the threshold parameter, and Ri is the measured response value.
The constraint Σλi = 1 ensures the composite score remains on a 0–100 scale. The normalization function φ clamps each variable's contribution to prevent any single catastrophic failure from producing a negative score or any single perfect score from inflating beyond bounds.
Why Weighted Composites?
Not all variables matter equally. If an AI crawler cannot physically reach your website, it doesn't matter how beautiful your schema markup is. The weighting function reflects this hierarchy of dependencies. A site that blocks all 8 major AI crawlers in robots.txt scores differently than a site with perfect crawler access but missing structured data.
The mathematical property we're optimizing for is monotonicity with diminishing returns: fixing the highest-weighted failing variable produces the largest score improvement, while marginal gains on already-passing variables produce progressively smaller improvements. This matches the real-world behavior of AI recommendation systems.
The Variable Space
Our research has identified over 20 signals that influence whether an AI platform will crawl, index, understand, and ultimately recommend a website. These span four categories:
Crawlability Variables
AI Bot Access — Whether GPTBot, ClaudeBot, PerplexityBot, GoogleBot, Bingbot, Bytespider, AppleBot, and other AI-specific user agents can successfully reach your site. Measured via live HTTP requests with accurate user-agent strings.
robots.txt Configuration — Whether the robots.txt file explicitly allows or blocks AI crawlers. Many sites inadvertently block AI through wildcard disallow rules or legacy configurations targeting older bots.
llms.txt Presence — The emerging standard for providing AI platforms with a machine-readable summary of your site. Analogous to robots.txt but designed specifically for LLM consumption.
XML Sitemap Accessibility — Whether a well-formed sitemap exists and is discoverable by AI crawlers, enabling efficient page discovery.
Canonical Tag Consistency — Whether canonical URLs are properly defined to prevent AI from indexing duplicate content and diluting authority.
Performance Variables
Time to First Byte (TTFB) — Server response latency. AI crawlers have timeout thresholds; slow sites get partially indexed or skipped entirely.
JavaScript Rendering Dependency — Whether critical content requires client-side JavaScript execution. Most AI crawlers do not execute JavaScript, meaning JS-dependent content is effectively invisible.
Core Web Vitals Composite — Largest Contentful Paint, First Input Delay, and Cumulative Layout Shift as a combined performance indicator.
Mobile Rendering Fidelity — Whether the mobile version of the site contains the same content as desktop, since some crawlers use mobile user agents.
Structural Variables
JSON-LD Schema Markup — Whether structured data exists in a format AI can parse: LegalService, Attorney, LocalBusiness, FAQPage, HowTo, and Review schemas.
Content Structure & Hierarchy — Proper use of heading tags (H1–H6), meta descriptions, and semantic HTML that enables AI to extract structured answers.
FAQ Schema Depth — The presence and quality of FAQ structured data, which AI platforms frequently cite verbatim in responses.
Entity Density — How clearly people, places, practice areas, and credentials are defined in machine-readable formats.
Internal Linking Depth — How well pages cross-reference each other, creating a knowledge graph the AI can traverse.
Trust & Authority Variables
SSL & Security Headers — HTTPS status, HSTS, Content-Security-Policy, and other security signals that AI platforms use as trust indicators.
Open Graph Meta Tags — Social metadata that AI platforms read to understand page summaries and context.
Backlink Authority from AI-Cited Sources — Whether authoritative sources that AI already trusts link to your site.
Review Schema Presence — Whether structured review data exists that AI can surface in recommendations.
Multilingual Hreflang Signals — For multi-language sites, whether language variants are properly declared for AI serving different locales.
Social Proof Signal Density — Structured indicators of credibility: awards, memberships, certifications, case results.
Structured Data Completeness Ratio — The percentage of available schema types that are actually implemented versus the total applicable to the business type.
Grade Mapping
The composite score maps to a letter grade using standard academic thresholds:
In our dataset of over 1,000 law firm websites audited, the median score is 58 — an F grade. Fewer than 3% achieve an A. The most common failure mode is blocked AI crawler access combined with absent structured data.
Why This Matters
The shift from keyword-based search to AI-generated recommendations is not incremental — it's structural. When a potential client asks ChatGPT "who's the best personal injury lawyer in Chicago," the AI doesn't return 10 blue links. It returns 1–3 names. The scoring methodology described here determines whether your firm is one of them.
The variables are public knowledge. The weights are not. And the weights are where the value lives — because they reflect empirical testing of which signals actually influence AI recommendation behavior, not which signals seem theoretically important.
We publish the framework because transparency builds trust. We protect the weights because they represent thousands of hours of testing and calibration.
See How AI Scores Your Firm
Run Luna's free 9-point technical audit. Get your AI Readiness Score in 60 seconds.
Scan My Site →