Sub topic 2
Citations: which sources an answer links to
This chapter assumes you know what an AI answer engine is, can read percentages, and have seen the term "mention" before. A citation is a link that an answer engine shows as a source for its text. A mention is a brand name in the answer text. Record them separately. A brand can be mentioned without being cited, and cited without being named.
To count citations, collect every URL from each run, then check whether the URL's domain belongs to your brand. The citation rate is the share of runs with at least one of your URLs.
Share of voice: your mentions relative to competitors
Share of voice is your mentions divided by all brand mentions in the same set of responses. Use one prompt set and one matching rule for every brand, or the ratio compares different measurements.
mentions = {"Acme": 6, "Globex": 9, "Initech": 5}
total = sum(mentions.values())
for brand, count in mentions.items():
print(f"{brand}: {count / total:.0%}")The output is Acme 30%, Globex 45%, and Initech 25%.
Position and sentiment within an answer
Position is where a brand first appears in the answer text. Sentiment is whether the wording around the brand is positive, neutral, or negative. A brand named first in a warning, such as "avoid Acme because of slow support," scores well on position and poorly on sentiment. Check these by reading the context, or use a classifier and spot-check its labels.
Variability between runs and how to sample for it
The same prompt can produce a different answer on each run. Repeat each prompt several times and report the rate with its uncertainty. Three mentions in 10 runs gives a 30% rate, but the 95% interval runs from about 11% to 60%. Compare two periods only when their intervals do not overlap.
Exercise
Across 5 runs of the same prompt set, the answers contain 2 mentions of Acme, 3 of Globex, and 0 of Initech. What is Acme's share of voice?
Show answer
2 / 5 = 40%. Share of voice uses the total mentions across all brands, which is 5 here.