Models

What Is Feature Importance?

A ranking of how much each input feature contributes to a model's predictions, computed via permutation, gradient, SHAP, or tree-split methods.

What Is Feature Importance?

Feature importance is a model-explainability ranking that estimates how much each input feature contributes to a prediction. In production ML, teams compute it with permutation tests, SHAP values, gradients, or tree-model split statistics to spot leakage, unexpected predictors, and drift. In LLM and RAG systems, FutureAGI treats the equivalent as token-, chunk-, or source-level attribution: which retrieved chunk, tool output, or prompt span shaped the answer. Feature importance is correlational evidence, not causal proof.

Why feature importance matters in production LLM and agent systems

Models that ship without an importance audit ship with hidden risks. A churn-prediction model that turns out to lean on customer_id is leaking the label. A loan-approval model that puts heavy weight on a zip-code-derived feature is encoding redlining. A RAG system that puts 90% of its weight on one boilerplate chunk is not really retrieving anything. Feature importance is the pre-deploy diagnostic that catches these patterns before they become incidents.

The pain falls on different roles. ML engineers stare at a model with 92% accuracy that fails on every realistic counterfactual. Product leads cannot explain to the executive team why the model decides what it decides. Compliance teams reading EU AI Act Article 13 (transparency) or model-card obligations need an importance ranking to fill the form. Auditors ask “what features drive this output” and get blank stares.

In 2026-era agent stacks, the surface broadens. A RAG agent’s “feature” is a retrieved chunk, a tool output, a memory lookup. Importance for these surfaces means: which chunk was cited, which tool’s response shaped the answer, which memory snippet anchored the trajectory. FutureAGI’s ChunkAttribution and SourceAttribution evaluators run on every trace and produce per-chunk contribution scores — so when a wrong answer happens, the team can see which input drove it. Without per-chunk attribution, RAG debugging becomes guesswork; with it, the failing chunk is named and the fix targets the retriever or the prompt.

How FutureAGI handles feature importance

FutureAGI’s approach is to expose the LLM equivalent of feature importance — chunk and source attribution — as a built-in evaluator that runs at trace time. ChunkAttribution returns a per-chunk score showing which retrieved chunks were actually used in generation. ChunkUtilization quantifies the inverse — how much of each chunk was consumed. SourceAttribution evaluates citation quality in RAG responses. Together they give a structured “importance” view across the retrieval-to-generation pipeline.

A concrete workflow: a RAG team instrumented with traceAI’s langchain integration sees Faithfulness drop on a specific user cohort. They pull traces from the failing cohort and run ChunkAttribution on the cohort’s outputs. Eight of ten failures attribute to a single boilerplate chunk that is being retrieved due to high embedding similarity but contributing no actual content. The team adds a metadata filter to the retriever and reruns Faithfulness plus RAGScoreDetailed to confirm the score recovers. The dashboard shows the boilerplate chunk’s importance dropping from 0.6 to 0.04. Unlike SHAP, which attributes feature-level changes in tabular models, FutureAGI’s trace view attributes retrieved chunks and sources for RAG outputs. For tabular models running through FutureAGI’s wrapper, permutation-importance plots produced offline are stored alongside the model artifact for audit. We’ve found that LLM-era feature importance is less about coefficient weights and more about chunk-level traceability — when you can name the chunk that drove the wrong answer, you can fix the retriever, not the model.

How to measure feature importance

Feature importance is computed differently for tabular models and LLM systems:

  • Permutation importance: drop in accuracy when each feature is shuffled.
  • SHAP values: per-prediction attribution that sums to the model output.
  • ChunkAttribution: per-chunk score showing which RAG chunks were cited.
  • ChunkUtilization: how much of each chunk was consumed in generation.
  • SourceAttribution: citation quality across the response.
  • Gradient or attention attribution: token-level importance for transformer models.
  • Per-cohort importance: features that matter for one cohort and not another flag bias risk.
from fi.evals import ChunkAttribution

attr = ChunkAttribution()
result = attr.evaluate(
    input="What was Q3 revenue?",
    output="Q3 revenue was $42M.",
    context=["Doc1: revenue chart", "Doc2: irrelevant"]
)
print(result.score, result.reason)

Common mistakes

  • Treating importance as causation. It is correlational; a high-importance feature is not necessarily the cause.
  • Using only one method. Permutation and SHAP can disagree; report both for tabular work.
  • Ignoring per-cohort importance. Features that matter for one cohort and not another are a fairness flag.
  • For LLMs, skipping chunk attribution. Without it, a “RAG hallucination” cannot be traced to a specific chunk.
  • Recomputing importance only at training. Importance can drift as input distributions shift; recompute on production samples.

Frequently Asked Questions

What is feature importance?

Feature importance is a ranking of how much each input feature contributes to a model's predictions. It is used to debug models, detect leakage, and surface unexpected predictors. It is correlational, not causal.

What is the LLM equivalent of feature importance?

Chunk attribution and source attribution. In RAG, the question is which retrieved chunks drove the response. FutureAGI's `ChunkAttribution` and `SourceAttribution` evaluators answer this per-trace.

How do you compute feature importance?

For tabular ML: permutation importance, SHAP, or tree-model splits. For LLMs: `ChunkAttribution` for retrieved context, gradient or attention attribution for token-level. FutureAGI surfaces RAG-level attribution at the trace dashboard.