"Every AI feature should pay for itself. Feature margin analysis reveals which features are assets and which are liabilities masquerading as innovation."
A VP of Product Who Reads Unit Economics
Feature Margin Analysis
Feature margin analysis examines the revenue and cost associated with each AI feature to determine its profitability. A feature with positive margin generates more value than it costs. A feature with negative margin is subsidized by other features or investor capital.
Margin Calculation
Calculate margin per feature:
from dataclasses import dataclass
from typing import Optional
@dataclass
class FeatureMargin:
feature_name: str
# Volume metrics
daily_active_users: int
avg_sessions_per_user: float
avg_calls_per_session: float
# Revenue metrics
revenue_per_user: float
conversion_rate: float # % sessions that lead to revenue
# Cost metrics
cost_per_call: float
infrastructure_cost_pct: float = 0.2 # Non-token costs
@property
def daily_volume(self) -> int:
return int(self.daily_active_users * self.avg_sessions_per_user)
@property
def daily_calls(self) -> int:
return int(self.daily_volume * self.avg_calls_per_session)
@property
def daily_revenue(self) -> float:
paying_users = self.daily_active_users * self.conversion_rate
return paying_users * self.revenue_per_user
@property
def daily_cost(self) -> float:
token_cost = self.daily_calls * self.cost_per_call
infra_cost = token_cost * self.infrastructure_cost_pct
return token_cost + infra_cost
@property
def daily_margin(self) -> float:
return self.daily_revenue - self.daily_cost
@property
def margin_percentage(self) -> float:
if self.daily_revenue == 0:
return 0
return (self.daily_margin / self.daily_revenue) * 100
@property
def unit_economics(self) -> dict:
return {
"cost_per_session": self.daily_cost / self.daily_volume,
"revenue_per_session": self.daily_revenue / self.daily_volume,
"margin_per_session": self.daily_margin / self.daily_volume,
"cost_per_user": self.daily_cost / self.daily_active_users,
"revenue_per_user": self.daily_revenue / self.daily_active_users,
}
Classifying Features by Margin
Features can be classified by margin into categories that guide investment strategy. Cash cow features have margins above sixty percent and should be optimized and maintained with high quality since they generate significant profits. Growth driver features have margins between thirty and sixty percent and warrant investment and scaling to capture more value. Strategic features have margins between ten and thirty percent and should be monitored closely while justifying ongoing investment. Subsidized features have margins below ten percent or negative margins and should be optimized aggressively or considered for sunset if they cannot be turned around.
Negative Margin Features
A feature with negative margin may still be rational if it drives usage of positive-margin features. The key is to measure and understand these relationships rather than running features blindly.
ROI Analysis for AI Features
Calculating Feature ROI
@dataclass
class FeatureInvestment:
feature_name: str
# Development investment
initial_dev_cost: float
ongoing_dev_cost_monthly: float
# Infrastructure investment
infrastructure_setup: float
infrastructure_monthly: float
# Expected returns
expected_monthly_revenue: float
expected_monthly_cost_savings: float
expected_user_growth_pct: float
# Timeline
months_to_develop: int
payback_months_target: int = 12
def roi(self, months: int = 12) -> float:
"""Calculate ROI over specified months."""
initial_investment = self.initial_dev_cost + self.infrastructure_setup
ongoing_investment = self.ongoing_dev_cost_monthly * months
ongoing_infra = self.infrastructure_monthly * months
total_investment = initial_investment + ongoing_investment + ongoing_infra
total_returns = (
self.expected_monthly_revenue * months +
self.expected_monthly_cost_savings * months
)
if total_investment == 0:
return 0
return ((total_returns - total_investment) / total_investment) * 100
def payback_period(self) -> float:
"""Calculate months until investment breaks even."""
monthly_net = self.expected_monthly_revenue + self.expected_monthly_cost_savings
monthly_investment = self.ongoing_dev_cost_monthly + self.infrastructure_monthly
net_after_infra = monthly_net - monthly_investment
if net_after_infra <= 0:
return float('inf')
initial = self.initial_dev_cost + self.infrastructure_setup
return initial / net_after_infra
Practical Example: QuickShip Route Optimization ROI
The QuickShip team was evaluating their AI route optimization investment after leadership questioned the five hundred thousand dollar investment. They needed to justify the investment with concrete ROI calculations. They faced a dilemma about how to measure ROI for something that improves efficiency rather than directly generating revenue.
The team decided to conduct rigorous ROI analysis through a structured process. They established baseline metrics including average route efficiency, fuel costs, and driver time before AI implementation. They measured AI impact by running an A/B test with and without AI routing to isolate the effect. They measured costs including AI infrastructure costs, API costs, and ongoing maintenance. They calculated benefits including fuel savings, time savings, and capacity improvement from more efficient routing.
The results demonstrated strong returns: twelve percent reduction in fuel costs per delivery, eight percent improvement in deliveries per driver per day, and fifteen percent reduction in route planning headcount. Monthly cost savings reached eighty-five thousand dollars while monthly AI cost was twenty-two thousand dollars, resulting in a net monthly benefit of sixty-three thousand dollars and a payback period of eight months. The lesson is that AI investments require rigorous ROI analysis. The cost is certain, the benefit is not. Measure benefits before investing.
Optimization Decisions
Improving Feature Margins
For features with poor margins, identify optimization paths to improve profitability. Reduce token usage by optimizing prompts to use fewer tokens and implementing caching to avoid redundant API calls. Reduce model costs by routing to cheaper models where appropriate rather than always using the most capable model. Increase conversion by improving user experience to drive more value from each session. Increase efficiency by batching requests and optimizing infrastructure to reduce per-request overhead.
Sunset Decisions
Some features should be sunset rather than optimized:
def should_sunset_feature(feature: FeatureMargin, min_margin: float = -10) -> tuple[bool, str]:
"""
Determine if a feature should be sunset.
"""
if feature.margin_percentage > min_margin:
return False, "Feature margin acceptable"
if feature.daily_active_users > 10000:
return False, "High user base, investigate optimization"
# Calculate cost to maintain
maintenance_cost_monthly = feature.daily_cost * 30
if maintenance_cost_monthly < 1000:
return True, f"Low usage, low cost - candidate for sunset"
return True, f"Negative margin {feature.margin_percentage:.1f}%, evaluate ROI"
Feature Portfolio Analysis
Portfolio Dashboard Metrics
Track portfolio dashboard metrics to understand the overall health of your AI feature portfolio. Portfolio margin is the weighted average margin across all features with a target above forty percent. Margin concentration measures the percentage of margin coming from the top three features with a target below eighty percent, since high concentration indicates vulnerability if those features decline. Feature ROI is the average ROI across active investments with a target above one hundred percent. Optimization pipeline tracks features with active optimization efforts with a target of five or more to ensure continuous improvement.
Prioritizing Optimization Investments
When deciding where to invest optimization effort, consider four factors that together determine the priority score for each opportunity. Impact measures the potential margin improvement from optimization, indicating how much value could be captured. Effort measures the engineering time and complexity required, indicating the investment needed. Risk measures the likelihood of successful optimization, accounting for technical uncertainties. Strategic value measures the importance to the overall product, capturing whether the feature is critical to the product strategy or more peripheral.
@dataclass
class OptimizationOpportunity:
feature_name: str
current_margin: float
potential_margin: float
effort_weeks: int
success_probability: float
@property
def expected_improvement(self) -> float:
return (self.potential_margin - self.current_margin) * self.success_probability
@property
def priority_score(self) -> float:
return self.expected_improvement / self.effort_weeks
Research Frontier
Research on "AI portfolio management" explores treating AI features like financial portfolios, applying concepts like diversification, hedging, and risk-adjusted returns. This could help product teams make more systematic investment decisions.