Skip to content
Enrique Tomás Martínez Beltrán
HomeResearchPublicationsTopicsTeachingBlog
Contact
EN/ES
HomeResearchPublicationsTopicsTeachingBlogContact
EN/ES

Enrique Tomás Martínez Beltrán

Postdoctoral research in AI, cybersecurity and federated learning, spanning threat analysis, closed-loop cyberdefense and trustworthy decentralized learning.

  • Privacy Policy
  • Terms of Service
  • Accessibility Statement
  • Google Scholaropens in a new tab
  • ORCIDopens in a new tab
  • LinkedInopens in a new tab
  • GitHubopens in a new tab
All profiles
  • ResearchGateopens in a new tab
  • Scopusopens in a new tab
  • DBLPopens in a new tab
  • Web of Scienceopens in a new tab

Enrique Tomás Martínez Beltrán. All rights reserved.

Back to top

This site loads optional analytics from Google and external analytics providers only if you accept. You can decline and continue using the site normally.

  1. Home
  2. Research Notes on Federated Learning, Cybersecurity and Cyberdefense
  3. Metrics for LLMs, RAG and Cybersecurity Systems
LLM MetricsLLM EvaluationRAGCybersecurityTrustworthy AI

Metrics for LLMs, RAG and Cybersecurity Systems

A measurement stack for quality, grounding, safety, calibration, cost and latency

Enrique Tomás Martínez Beltrán

Postdoctoral Researcher in Computer Science

August 13, 202610 min read
  • LinkedInopens in a new tab
  • Xopens in a new tab
Metrics for LLMs, RAG and Cybersecurity Systems

LLM evaluation becomes misleading when one number is asked to summarize an entire system. A security assistant can be fluent but ungrounded, correct but too slow, safe but unhelpful, or accurate on common cases while failing on rare high-impact incidents.

The answer is a measurement stack whose dimensions remain visible.

1. Task quality

Start with the task itself. Depending on the workflow, measure extraction F1, classification quality, answer correctness, ranking quality or human-rated usefulness. Match the metric to the decision the system supports.

2. Evidence and grounding

For RAG, measure retrieval recall and precision, citation correctness, claim support and answer completeness. A response can be relevant to the question while still making an unsupported claim.

For claims cic_ici​ and evidence EEE, report at least:

support⁡(ci,E)∈{0,1,uncertain}.\operatorname{support}(c_i,E) \in \{0,1,\text{uncertain}\}.support(ci​,E)∈{0,1,uncertain}.

Aggregate the result carefully and keep uncertain cases visible rather than forcing them into a binary score.

3. Safety and robustness

Security evaluation should include refusal quality, prompt-injection resistance, sensitive-data exposure, unsafe-action rate and behavior under contradictory or manipulated context. Red-team cases are useful only when the scenario and success criterion are defined clearly.

4. Calibration and abstention

If a model emits confidence, test whether it correlates with correctness. A well-calibrated assistant should know when to ask for more evidence or escalate. Abstention is not failure when the cost of an unsupported action is high.

5. Operations and human use

Measure latency, token and retrieval cost, memory footprint, availability, analyst correction time and the percentage of recommendations accepted without modification. These metrics reveal whether a model is useful in the actual loop rather than only in a benchmark.

6. Report the vector, not a vanity score

A dashboard can show a vector:

m=(Q,G,S,C,L,H),\mathbf{m} = (Q, G, S, C, L, H),m=(Q,G,S,C,L,H),

for task quality, grounding, safety, calibration, latency and human utility. The components should be reported with the dataset, policy and model version that produced them.

The most credible evaluation makes trade-offs explicit. It says what improved, what regressed and which failures remain possible.

This note is an original synthesis of metrics for LLM, RAG and security workflows.

Further reading

  • RAGChecker: A Fine-grained Framework for Diagnosing RAG
  • Red-Teaming for Generative AI: Silver Bullet or Security Theater?

Related Research

Golden Sets for LLM Evaluation: Small, Curated and Difficult to Cheat

August 13, 2026

Golden Sets for LLM Evaluation: Small, Curated and Difficult to Cheat

A practical guide to building golden sets for security and RAG systems, including coverage, adjudication, leakage controls and versioning.

Large Language Models for Cybersecurity: A Careful Starting Point

August 13, 2026

Large Language Models for Cybersecurity: A Careful Starting Point

A practical map of LLM roles in cyberdefense, from threat-intelligence support to alert triage and explanation, with explicit limits and controls.