CoolFace
Modelpublic

laskar-ks/qwen2.5-0.5b-revenue-estimator

sourceHugging Faceapache-2.0updated 1mo agoView on Hugging Face
0likes16downloads
Model Card

Rigel — Company Revenue-per-Employee Estimator

A LoRA adapter for Qwen/Qwen2.5-0.5B that estimates a company's revenue per employee from its business description, with every company name redacted.

Multiply the prediction by headcount to recover total revenue.

Curated dataset: https://huggingface.co/datasets/laskar-ks/company-revenue-estimation

The task

Input — sector, industry, headcount, and a business description where every company name, ticker and brand token is replaced with [COMPANY].

Output — a single number: log10(revenue per employee) in USD.

Redaction is the point. Left in, the names let a model recognise the brand and recall the answer; that is memorisation, not skill, and it collapses on unseen companies. Removed, the model has to read the business itself.

Revenue per employee — rather than revenue — is the target because headcount alone explains 87% of revenue (r = 0.931) but is uncorrelated with productivity per employee (r = 0.008). Predicting revenue directly would leave almost nothing for the text to contribute.

Evaluation

356 held-out US-listed companies. Greedy decoding, predictions clamped to [4.0, 7.0], identical scoring for every row in the table.

ModelReads textMAE (dex)R²
Constant (training mean)no0.310-0.001
Sector meanno0.2940.085
Linear (headcount + sector + industry)no0.2600.213
TF-IDF + Ridgeyes0.2540.318
Qwen2.5-0.5B zero-shotyes1.360-10.562
Qwen2.5-0.5B 3-shotyes0.609-1.809
This adapter, no descriptionno0.274+0.181
This adapteryes0.248+0.339

MAE is in dex (decimal exponents): 0.248 dex means the typical guess is off by a factor of 1.77.

Standard error of the MAE is 0.012 dex, so gaps smaller than about 0.025 dex should not be read as differences.

Fine-tuning fixed output format completely

out-of-range predictions
Zero-shot356 / 356 (100%)
This adapter0 / 356 (0.0%)

The base model answers in dollars, ignoring the log10 instruction, and repeats round numbers such as $1,000,000 for most companies.

Ablation: does reading actually help?

Two adapters trained with identical hyperparameters, seed, and splits. Only the input column differs.

MAE (dex)R²
With description0.248+0.339
Without description0.274+0.181
Paired difference+0.0262+0.159
95% CI (paired bootstrap, 5000 resamples)[+0.0099, +0.0436]

The interval excludes zero: reading the description measurably helps.

The gain is concentrated rather than uniform — it improves 51% of companies, and helps most where a sector label is misleading. Real Estate, Basic Materials and Energy benefit most; Industrials and Communication Services show no gain.

Usage

python
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

BASE = "Qwen/Qwen2.5-0.5B"
tokenizer = AutoTokenizer.from_pretrained(BASE)
base = AutoModelForCausalLM.from_pretrained(BASE, torch_dtype=torch.float16, device_map="cuda")
model = PeftModel.from_pretrained(base, "laskar-ks/qwen2.5-0.5b-revenue-estimator").eval()

prompt = (
    "Sector: Technology\n"
    "Industry: Software - Application\n"
    "Employees: 1,200\n"
    "Description: [COMPANY] provides a cloud-based platform for enterprise workflow "
    "automation, sold on subscription to mid-market and enterprise customers.\n"
    "\n"
    "Revenue per employee, log10 USD:"
)

inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=12, do_sample=False,
                     pad_token_id=tokenizer.eos_token_id)
answer = tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)

log_ratio = float(answer.strip().split()[0])
revenue = 10 ** log_ratio * 1200
print(f"{10 ** log_ratio:,.0f} per employee -> {revenue:,.0f} total revenue")

The prompt format must match exactly, including the [COMPANY] placeholder. Sending a real company name gives the model a format it was never trained on.

Training

MethodLoRA (r=16, alpha=32, dropout=0.10)
Target modulesq, k, v, o, gate, up, down
Learning rate2e-4, cosine schedule, 5% warmup
Effective batch16 (batch 4 x grad accum 4)
Epochs4 configured, best at epoch 3 (early stopping, patience 1)
Precisionfp16
Hardwaresingle Colab T4
Training rows2,852

Loss is computed on the answer tokens only; the prompt is masked with -100. Without that mask, roughly 99% of the loss would come from reproducing the business description.

Limitations

  • —Trained only on US-listed companies reporting in USD. Private and non-US companies are out of scope.
  • —2,852 training rows is small. Rare industries are weakly represented.
  • —Redaction cannot catch product brands that share no tokens with the parent company name, so some companies remain identifiable from context.
  • —Predictions have a narrower spread than reality (std 0.262 vs 0.419), which is the expected response to genuine uncertainty rather than a defect.
  • —A TF-IDF + ridge regression on the same text reaches comparable overall accuracy. This adapter is not a demonstration that LLMs beat classical methods here.
  • —Not a valuation tool. Estimating scale from text does not replace financial statements.

Attribution

Training data derived from defeatbeta/yahoo-finance-data, licensed ODC-BY, sourced from Yahoo Finance. Released for research and education.