56.1 Deep Learning Architecture Selection
| Architecture | Type | Primary Enterprise Use Cases |
|---|---|---|
| CNN | Convolutional | Document image classification, defect/anomaly detection in images, medical/industrial imaging |
| RNN/LSTM | Recurrent | Sequential text modeling, time-series with strong sequential dependence |
| Transformer | Attention-based | NLP (extraction, summarization, generation), now dominant architecture for most enterprise text and increasingly multimodal tasks |
| GAN | Generative | Synthetic training data generation (privacy-preserving augmentation), data imbalance mitigation |
| Autoencoder | Encode/decode | Anomaly detection (reconstruction error signals outliers), dimensionality reduction |
| Graph Neural Network (GNN) | Graph-based | Fraud/relationship detection, recommendation over graph-structured entities |
Architect’s framing: Transformers have become the default architecture for nearly all enterprise NLP and much of multimodal work — the practical decision today is less “which architecture” and more “fine-tune vs. prompt a foundation model vs. train small task-specific model,” which is covered under NER/summarization strategy in Section 53. CNNs and autoencoders remain the right call for pure vision/anomaly tasks that don’t need language understanding.
56.2 Reinforcement Learning in Enterprise Systems
RL is a niche but high-leverage tool for sequential decision-making problems where the optimal policy isn’t obvious from static rules and there’s a clear reward signal to optimize against.
RL Framing Example: Automated Decision/Escalation Agent
Agent: Decision-management bot (e.g., dispute resolution, routing, pricing)
State: Current case status, historical context, prior actions taken
Actions: {Escalate, Retry, Write-off/Close, Request more info, Route to specialist}
Reward: Value recovered/resolved − cost of action taken − time penalty
RL learns an action policy per (context, historical pattern) combination
that a fixed rule set could not easily encode, by learning from thousands
of historical outcome trajectories (offline RL) and/or live experimentation
(online RL with guardrails).
Offline vs. online RL for enterprise:
| Mode | Description | Risk | When to Use |
|---|---|---|---|
| Offline RL | Learn policy entirely from historical logged data, no live experimentation | Low (no live risk) but policy quality limited by historical data coverage | Default starting point — always start here |
| Online RL / bandits | Policy updates from live interaction, with exploration | Higher (real actions have real cost) | Only after offline policy is validated; use with strict guardrails and capped exploration budget |
| RLHF-style (human feedback as reward) | Reward model trained from human preference labels, policy optimized against it | Used for aligning generative model behavior, not typical for tabular decision systems | LLM/agent behavior tuning, not classic enterprise decisioning |
Why RL is used sparingly in enterprise settings: it requires a well-defined, reliable reward signal (often the hardest part), tolerates exploration poorly in regulated or customer-facing contexts, and is harder to audit/explain than supervised models. The typical enterprise path is: start with supervised learning + business rules, and only reach for RL when the problem is genuinely sequential (today’s action changes tomorrow’s optimal action) and a supervised “predict the best single action” framing has plateaued.
56.3 RLHF and Reward Modeling (Applied to LLM/Agent Systems)
RLHF Pipeline (for aligning agent/LLM behavior to enterprise preferences)
Human preference data (A vs B comparisons)
│
▼
Reward Model training (predicts human preference score)
│
▼
Policy optimization (PPO / DPO) against reward model
│
▼
Aligned model behavior → Evaluate against golden dataset (Section 58)
In most enterprise contexts, full RLHF is out of reach (compute and data cost), but the same underlying idea is used lightweight via DPO (Direct Preference Optimization) on collected preference pairs from production feedback, or even more simply via prompt-level and retrieval-level tuning driven by the feedback loops described in Section 63.
Interview Q&A — Section 56
Q1: A stakeholder asks whether you should use reinforcement learning for an automated escalation/routing decision. How do you decide? A: I check three things first: (1) Is the reward signal well-defined and measurable soon after the action (not months later)? (2) Is the problem genuinely sequential — does today’s decision affect the value of tomorrow’s options — or is it really just “pick the best single action,” which supervised learning handles better and more auditable? (3) Do we have enough historical trajectory data to train offline RL safely, since live exploration in a regulated/customer-facing process is risky? If the reward signal is fast and clear and the problem is truly sequential, I’d start with offline RL trained on historical logs, validate it extensively against a supervised baseline and business rules before considering any live exploration, and keep human override available at every step. If any of the three checks fail, I’d stick with a supervised model plus explicit business rules — simpler, more auditable, and usually gets 90% of the value.
Q2: When would you use a CNN versus a Transformer for a document image classification task? A: A CNN (or a lightweight vision model) is the right default when the task is purely visual — classifying document type from layout/visual structure without needing to read and understand the text content, and where you want low latency and a small model footprint for high-volume triage. A Transformer-based multimodal/vision-language model becomes the better choice when classification genuinely depends on textual content and layout together (e.g., distinguishing similarly-formatted document types that differ only in the text they contain), or when you want a single model that also performs downstream extraction, not just classification. In practice I often chain them: a fast CNN classifier for coarse document-type routing at high volume, followed by a transformer-based extraction pipeline only on the routed subset — this keeps cost proportional to complexity.
Q3: Explain how RLHF/DPO concepts apply outside of foundation-model training, in a typical enterprise agent system. A: Full RLHF (reward model + PPO) is rarely practical for enterprise teams — it needs large preference datasets and heavy compute. But the underlying idea scales down well: collect explicit/implicit production feedback (Section 63) as preference pairs (e.g., “response A was thumbs-upped over a similar response B”), and use lightweight preference-optimization techniques like DPO to fine-tune a smaller open-weight model, or — even more commonly — feed those preference patterns into prompt and retrieval refinement rather than weight updates at all. The architectural takeaway for an interview: RLHF is a spectrum, and most enterprise teams operate at the “preference data drives prompt/retrieval iteration” end rather than the “train a new reward model and run PPO” end, reserving full RLHF-style training for teams that also own base model fine-tuning infrastructure.