Notícias
Notícias
5 min de leitura
21 de setembro de 2026

Seu agente fala bem mas decide mal (precisa RL training)

LLM-only agents talk natural but decide poorly. DAPO (ByteDance): RL training makes agents reason + decide better.

Equipe OpenClaw

Equipe OpenClaw · Time de Engenharia & Produto

A Equipe OpenClaw é formada por engenheiros, designers e especialistas em IA dedicados a construir a melhor plataforma de agentes conversacionais para negócios brasileiros. Combinamos expertise…


Seu agente fala bem mas decide mal (precisa RL training).

Você é founder de SaaS.

Seu agente roda no WhatsApp.

Customer pergunta: "Qual é meu saldo?"

Agent responde: "Seu saldo atual é R$5.000. Posso ajudar com algo mais?"

Perfeitamente natural.


Mas aí:

Customer: "Pode transferir R$4.999 pra minha outra conta? Só deixa R$1 aqui."

Agent responde: "Claro! Transferência feita com sucesso."

PROBLEM: Agent nunca deveria ter permitido isso.

Por quê?

  • Transferência > 90% do saldo = suspicious (fraud risk)
  • Customer pode estar vítima de golpe
  • Seu SaaS é responsável legalmente
  • Deveria ter escalado pra human review

Mas agent não fez.

Por quê agent tomou decisão errada?

Porque seu agent não foi treinado pra DECIDIR MELHOR.

Foi treinado pra FALAR MELHOR.

Big difference.


Ontem, notícia fez buzz:

ByteDance (WeChat, ByteCore) + Tsinghua University lançaram DAPO:

Open-source RL system pra treinar agents a fazer melhores DECISÕES (não só melhor linguagem).

Em português:

RL = Reinforcement Learning = Ensinar agent via reward/penalty (tipo treinador de cachorro).

Ideia:

  • Agent toma decisão
  • Você dá feedback: "Boa decisão!" (reward) ou "Má decisão!" (penalty)
  • Agent aprende: "Próxima vez, evite isso"
  • Repeat 1000x
  • Agent agora decide MELHOR

Vamos explorar.


O problema: LLM-only agents são excelentes em linguagem, péssimos em decisão

Por que "natural sounding" não = "good decisions"

=== THE PROBLEM ===

Current LLM-only agent:

Customer: "Can I transfer most of my balance?" ↓ [GPT-4 / Claude] ├─ Task: Generate response ├─ Training data: Internet text (novels, forums, etc) ├─ Optimized for: Language quality (grammar, tone, naturalness) ├─ NOT optimized for: Decision quality (safety, compliance, business logic) │ └─ Result: "Of course! Let me process that transfer for you." └─ Natural? YES ✓ └─ Safe? NO ✗ └─ Compliant? NO ✗

=== WHY LLM FAILS AT DECISIONS ===

Reason 1: LLMs are trained on language, not business rules ├─ LLM sees: "transfer", "balance", "account" ├─ LLM knows: How to use these words in sentences ├─ LLM doesn't know: "Transfer >90% = fraud risk = escalate" ├─ LLM doesn't know: "Transfers >R$10k need compliance review" ├─ LLM doesn't know: Company-specific policies └─ Result: Makes decisions based on patterns, not logic

Reason 2: LLMs have no concept of consequence ├─ LLM sees: "Transfer R$4.999" ├─ LLM predicts: "Approval is friendly, matches customer request" ├─ LLM doesn't understand: This might be fraud, might hurt customer, might cost company ├─ LLM doesn't learn from: "Last time we approved similar, customer was scammed" └─ Result: Repeats same mistakes

Reason 3: LLMs can't reason about tradeoffs ├─ LLM doesn't weigh: "Customer satisfaction vs fraud risk" ├─ LLM doesn't weigh: "Speed vs compliance" ├─ LLM doesn't weigh: "Revenue vs legal liability" └─ Result: Always optimizes for one thing (pleasing customer), ignores others

Reason 4: LLMs have no mechanism to improve from feedback ├─ You tell LLM: "That was a bad decision" ├─ LLM: "OK, noted. Next request, I'll still use same logic." ├─ LLM doesn't learn from individual feedback ├─ LLM only learns from retraining on 1B tokens (expensive, slow) └─ Result: Same mistakes repeat

=== REAL EXAMPLES OF BAD AGENT DECISIONS ===

Example 1: Transfer risk ├─ Customer: "Transfer R$4.999 to new account" ├─ LLM agent: "Of course!" ├─ Reality: Fraud indicator (90% of balance, new recipient) ├─ Better decision: "I need to verify this. Let me connect you to our security team." ├─ Cost of bad decision: R$4.999 lost, customer churn, legal liability └─ Cost of good decision: 2 min wait (customer OK with it)

Example 2: Refund abuse ├─ Customer: "Can I refund 5 times in a row?" ├─ LLM agent: "Sure, I'll process those." ├─ Reality: Abuse pattern (trying to drain you) ├─ Better decision: "I can process 1 refund now. Additional refunds need manager review." ├─ Cost of bad decision: R$5k lost └─ Cost of good decision: Slight friction, prevents fraud

Example 3: Escalation failure ├─ Customer: "I'm being scammed, help!" ├─ LLM agent: "Let me check your account... everything looks normal." ├─ Reality: Phishing attack (agent missed red flags) ├─ Better decision: "This sounds urgent. Let me get our security team immediately." ├─ Cost of bad decision: Customer loses money, lawsuit └─ Cost of good decision: 30 second escalation delay

Example 4: Pricing logic ├─ Customer: "I want to pay R$1/month instead of R$99/month" ├─ LLM agent: "That's interesting. Let me see what we can do..." ├─ Reality: Invalid (below cost) ├─ Better decision: "Our minimum plan is R$29/month. Can I show you that option?" ├─ Cost of bad decision: R$98/month loss × 12 = R$1.176/year └─ Cost of good decision: Customer might still buy R$29 tier

=== THE ROOT CAUSE ===

LLMs are trained to predict next token (language task): ├─ Input: "Transfer R$4.999" ├─ LLM predicts: Next token is likely "approved" (because humans often say yes) ├─ LLM doesn't predict: Consequence (fraud, loss, liability) └─ Result: Wrong decision for wrong reasons

What you NEED: ├─ Agent trained to predict consequences (RL task) ├─ Input: "Transfer R$4.999" ├─ Agent predicts: Consequence is "fraud risk" (bad outcome) ├─ Agent decides: "Escalate" (right decision for right reason) └─ Result: Better decisions


A solução: Reinforcement Learning (RL) treina agents a decidir melhor

Como DAPO muda o jogo

=== WHAT IS DAPO? ===

DAPA = Distributed Alignment from Preference Optimization

Basically: Framework to train agents via feedback

How it works:

  1. Agent makes decision
  2. You provide feedback: "Good!" or "Bad!"
  3. Agent learns from feedback
  4. Agent makes better decisions next time
  5. Repeat 1000x → Agent becomes expert

=== TRADITIONAL LLM APPROACH ===

LLM training: ├─ Train on 1 trillion tokens (internet text) ├─ Learn language patterns ├─ Deploy agent ├─ Agent makes wrong decisions ├─ You complain ├─ No way to fix (LLM is fixed, can't retrain) ├─ Only option: Prompt engineering (add more rules to prompt) │ ├─ Prompt grows from 100 words → 1000 words │ ├─ Prompt becomes hard to maintain │ ├─ Edge cases keep appearing │ └─ Agent still makes mistakes └─ Result: Stuck

=== REINFORCEMENT LEARNING APPROACH (DAPO) ===

RL training: ├─ Start with base LLM (trained on language) ├─ Deploy agent ├─ Collect feedback on decisions: │ ├─ "Good decision" (reward) │ ├─ "Bad decision" (penalty) │ └─ Score: -1 to +1 ├─ Train agent on feedback (not language) │ ├─ Agent learns: "When transfer >90%, bad outcome" │ ├─ Agent learns: "When escalate fraud, good outcome" │ ├─ Agent learns: Business logic │ └─ Agent learns: Company-specific policies ├─ Deploy improved agent ├─ Collect more feedback ├─ Train again ├─ Repeat: │ ├─ Week 1: 70% good decisions │ ├─ Week 2: 80% good decisions │ ├─ Week 3: 90% good decisions │ ├─ Week 4: 95% good decisions │ └─ Continuous improvement └─ Result: Agent learns from your data

=== DAPO ADVANTAGE ===

Training efficiency: ├─ LLM retrain: 1 week, R$100k GPU cost, 1B tokens needed ├─ RL fine-tune (DAPO): 1 day, R$1k cost, 1000 decisions feedback needed ├─ Speed: 7x faster ├─ Cost: 100x cheaper └─ Result: You can iterate weekly instead of quarterly

Decision quality: ├─ LLM-only: 60-70% good decisions ├─ LLM + RL (DAPO): 90-95% good decisions ├─ Improvement: +25-35 percentage points └─ Result: Fewer bad decisions = less fraud, churn, liability

Customization: ├─ LLM-only: Same agent for all use cases (generic) ├─ LLM + RL (DAPO): Agent learns YOUR rules, YOUR business logic ├─ Result: Agent tailored to your company

=== HOW DAPO WORKS ===

Step 1: Collect decisions + feedback ├─ Scenario: "Customer wants to transfer 90% of balance" ├─ Agent decision: "Approve transfer" ├─ Your feedback: "PENALTY: This was fraud risk, should escalate" ├─ Score: -1 (bad decision) │ ├─ Scenario: "Customer wants to refund after 30 days" ├─ Agent decision: "Escalate to compliance team" ├─ Your feedback: "REWARD: Good caution, this was attempt fraud" ├─ Score: +1 (good decision) │ └─ Collect 1000 decision + feedback pairs

Step 2: Train agent on feedback ├─ Algorithm: Policy gradient RL ├─ Idea: Agent learns which decisions → high reward ├─ Result: Agent improves at decision-making (not language)

Step 3: Deploy improved agent ├─ Agent now has learned: │ ├─ "Transfer >90% = escalate" │ ├─ "Refund >30 days = escalate" │ ├─ "New recipient + large amount = escalate" │ ├─ "Multiple refunds in a row = escalate" │ └─ Your company-specific rules │ └─ Agent decision quality: 70% → 90%+

Step 4: Continuous improvement ├─ Deploy improved agent ├─ Collect feedback on new decisions ├─ Train weekly (not quarterly) ├─ Agent keeps improving └─ Decision quality: 90% → 95% → 98%+

=== REAL EXAMPLE: TRANSFER RISK ===

Before DAPO (LLM-only): ├─ Customer: "Transfer R$4.999 (90% of R$5k balance)" ├─ Agent: "Of course, let me process that!" ├─ Result: Fraud happens, customer loses money ├─ Your loss: R$4.999 + compliance fine

After DAPO (LLM + RL): ├─ Customer: "Transfer R$4.999 (90% of R$5k balance)" ├─ Agent: "I notice you're transferring 90% of your balance to a new recipient. This is unusual. Let me verify your identity first." ├─ Agent: Takes customer through verification ├─ Result: If fraud attempt, blocked. If legit, approved with confidence. ├─ Your win: Fraud prevented, customer protected

=== FINANCIAL IMPACT ===

Cost of bad decisions (LLM-only agent): ├─ Fraud losses: 0.5% of volume (R$250 per R$50k MRR) ├─ Chargebacks: +R$50 per incident ├─ Compliance fines: R$500/month (avg) ├─ Customer churn: 2% (due to frustration) = R$1k MRR loss ├─ Total monthly: R$1.8k └─ Annual: R$21.6k

Cost of implementing DAPO (LLM + RL): ├─ Engineering: 40 hours (R$12k) ├─ Training data collection: 10 hours (R$3k) ├─ Infrastructure: R$500/month └─ Total: R$15.5k setup + R$500/month

Benefit of better decisions (90-95% vs 60-70%): ├─ Fraud losses: 0.1% of volume (R$50 per R$50k MRR) ├─ Chargebacks: Minimal ├─ Compliance fines: R$50/month ├─ Customer churn: 0.5% (due to safety) = R$250 MRR loss ├─ Total monthly: R$300 └─ Annual: R$3.6k

Monthly savings: ├─ Before: R$1.8k/month in losses ├─ After: R$300/month in losses ├─ Savings: R$1.5k/month ├─ Payback period: 10 months └─ Year 2 ROI: 36x (R$18k savings)

=== DAPO VS ALTERNATIVES ===

Option 1: Prompt engineering (LLM-only) ├─ Cost: Free (just rewrite prompt) ├─ Effectiveness: 60-70% (no real improvement) ├─ Maintenance: High (prompt grows, gets messy) ├─ Time: 1 week per iteration └─ Result: Band-aid, not solution

Option 2: Rules engine (no LLM) ├─ Cost: R$30k engineering ├─ Effectiveness: 95%+ (rules are exact) ├─ Maintenance: High (update rules manually) ├─ Time: 2 weeks per rule change └─ Result: Good, but rigid (can't handle edge cases)

Option 3: LLM + RL (DAPO) ← BEST ├─ Cost: R$15.5k setup + R$500/month ├─ Effectiveness: 90-95% (learned, adaptive) ├─ Maintenance: Low (agent learns, not manual) ├─ Time: 1 day per iteration (continuous improvement) ├─ Flexibility: Handles edge cases (learned from data) └─ Result: Best of both worlds


Como implementar DAPO (4-6 semanas)

Step-by-step roadmap

=== PHASE 1: ASSESSMENT (Week 1) ===

Step 1: Identify decision scenarios ├─ List all decisions your agent makes: │ ├─ Transfer approval (Y/N) │ ├─ Refund approval (Y/N) │ ├─ Discount eligibility (yes/no/escalate) │ ├─ Escalation decision (escalate/handle) │ └─ Other decisions... │ └─ Target: 10-20 decision types

Step 2: Measure current performance ├─ For each decision, measure: % good decisions │ ├─ Transfer: 65% correct (missed fraud 35%) │ ├─ Refund: 72% correct (approved abuse 28%) │ ├─ Discount: 58% correct (gave too much discount 42%) │ └─ Escalation: 80% correct │ └─ Calculate cost of bad decisions: ├─ Transfer fraud losses: R$250/month ├─ Refund abuse: R$500/month ├─ Discounts given away: R$1.2k/month └─ Total: R$1.95k/month (R$23.4k/year)

Step 3: Prioritize decisions to improve ├─ Focus on highest-impact decisions first ├─ Start with: Transfers (biggest fraud risk) ├─ Then: Refunds (second biggest loss) ├─ Then: Discounts (third biggest loss) └─ Timeline: Improve 1-2 decisions per phase

=== PHASE 2: PREPARE TRAINING DATA (Week 1-2) ===

Step 1: Collect historical decisions ├─ Gather 500-1000 past decisions: │ ├─ Transfer A: Amount=R$500, Recipient=existing, Decision=approve → Outcome=OK ✓ │ ├─ Transfer B: Amount=R$5k, Recipient=new, Decision=approve → Outcome=FRAUD ✗ │ ├─ Refund A: Days_since_purchase=5, Decision=approve → Outcome=OK ✓ │ ├─ Refund B: Days_since_purchase=60, Decision=approve → Outcome=ABUSE ✗ │ └─ ... │ └─ Label each decision: Good (+1) or Bad (-1)

Step 2: Identify features ├─ What data points matter for decision? ├─ Transfer decision depends on: │ ├─ Amount (R$100 vs R$10k) │ ├─ Recipient (existing vs new account) │ ├─ Customer age (new vs 5 years) │ ├─ Transfer history (first time vs frequent) │ ├─ Time of day (normal vs 3am) │ └─ Other factors... │ └─ Refund decision depends on: ├─ Days since purchase ├─ Refund count (1st time vs 5th) ├─ Amount ├─ Product category └─ Other factors...

Step 3: Create training dataset ├─ Format: [{features: {...}, label: +1/-1}, ...] ├─ Example:

{ "features": { "amount": 4999, "recipient_is_new": true, "is_90_percent_balance": true, "time_of_day": "3am", "customer_age_days": 30 }, "label": -1, // Bad decision (fraud) "reason": "Transfer 90% of balance to new recipient at 3am = high fraud risk" }

│ └─ Total: 500-1000 labeled examples

=== PHASE 3: SETUP DAPO (Week 2) ===

Step 1: Install DAPO framework ├─ GitHub: BytedTsinghua-SIA/DAPO ├─ Install: pip install dapo (or clone repo) ├─ Setup: Configure for your decision task └─ Docs: Follow tutorial on GitHub

Step 2: Convert to DAPO format ├─ Your dataset → DAPO format ├─ Your features → DAPO state representation ├─ Your labels → DAPO reward signal └─ Your agent → DAPO policy

Step 3: Baseline your LLM agent ├─ Current LLM-only performance: 65% good decisions ├─ Target improvement: 90%+ good decisions ├─ Metric: Accuracy on test set └─ Baseline established

=== PHASE 4: TRAIN AGENT (Week 3) ===

Step 1: Fine-tune agent on feedback ├─ Input: Labeled decisions (500-1000 examples) ├─ Algorithm: Policy gradient RL ├─ Training time: 2-4 hours (GPU) ├─ Cost: R$50-200 (cloud GPU) └─ Output: Improved agent

Step 2: Evaluate improvement ├─ Test on held-out data (20% of dataset) ├─ Measure: Accuracy on unseen decisions ├─ Before: 65% good decisions ├─ After: 88% good decisions ├─ Improvement: +23 percentage points ✓ └─ Result: Success

Step 3: Error analysis ├─ Where does improved agent still fail? ├─ Example: Still wrong on 12% of decisions ├─ Analyze: What patterns cause failures? ├─ Collect more examples of failure cases └─ Plan: Iterate (add more training data)

=== PHASE 5: DEPLOY & MONITOR (Week 4) ===

Step 1: Shadow deployment ├─ Run improved agent in parallel (don't use decisions yet) ├─ Compare: Improved agent vs current LLM agent ├─ Measure: Accuracy, precision, recall ├─ Monitor: Any edge cases? ├─ Timeline: 1 week └─ Decision: Ready for production?

Step 2: Gradual rollout ├─ Day 1-2: 10% traffic → improved agent ├─ Day 3-4: 25% traffic → improved agent ├─ Day 5-6: 50% traffic → improved agent ├─ Day 7: 100% traffic → improved agent │ ├─ Monitor each step: │ ├─ Decision quality (accuracy) │ ├─ Fraud rates (should decrease) │ ├─ Customer satisfaction (should increase) │ ├─ Error rate (should stay low) │ └─ Latency (should be same) │ └─ Rollback trigger: If any metric degrades

Step 3: Ongoing improvement ├─ Week 1: Collect feedback on new decisions ├─ Week 2: Retrain on accumulated feedback ├─ Week 3: Deploy improved agent ├─ Repeat monthly │ ├─ Agent performance over time: │ ├─ Month 1: 88% (baseline) │ ├─ Month 2: 91% (first iteration) │ ├─ Month 3: 93% (second iteration) │ ├─ Month 4: 94% (third iteration) │ └─ Month 6: 96%+ (continuous improvement) │ └─ Result: Agent keeps getting smarter

=== FINANCIAL ROI ===

Costs: ├─ Engineering (setup): 40 hours × R$300 = R$12k ├─ Data annotation: 20 hours × R$150 = R$3k ├─ Cloud GPU (training): 10 × R$50 = R$500 ├─ Infrastructure (ongoing): R$500/month ├─ Total first month: R$15.5k └─ Total year 1: R$21.5k

Benefits: ├─ Fraud prevention: R$250/month → R$50/month = R$2.4k/year saved ├─ Refund abuse prevention: R$500/month → R$100/month = R$4.8k/year saved ├─ Discount optimization: R$1.2k/month → R$300/month = R$10.8k/year saved ├─ Chargeback reduction: R$500/month → R$50/month = R$5.4k/year saved ├─ Total annual benefit: R$23.4k └─ Net ROI: R$23.4k - R$21.5k = R$1.9k (Year 1)

(Note: Year 2+ ROI is much better because setup cost is amortized)


Conclusão

Simple verdade:

LLM-only agents falam bem mas decidem mal.

Porque foram treinados pra linguagem, não pra ações.

Solução: Treinar agent com RL (reinforcement learning).

DAPO (ByteDance) é framework open-source pra fazer isso.

Benefício:

  • Decisões melhores: 65% → 90%+ good decisions
  • Menos fraude: 60% redução em fraud losses
  • Menos abuso: 80% redução em refund abuse
  • Melhor compliance: Regras aplicadas consistentemente
  • Continuous improvement: Agent aprende toda semana

Custo:

  • Setup: R$15.5k (one-time)
  • Ongoing: R$500/month
  • Payback: 8 meses
  • ROI: 1.1x Year 1, 11x Year 2+

Próximo passo: Começa com DAPO THIS WEEK.

Seu agent está costandovoce dinheiro (bad decisions). DAPO está open-source e grátis pra começar.


Próximos passos

Na OpenClaw, ajudamos SaaS builders implementar RL + DAPO pra melhorar agent decision quality:

  • Decision Quality Audit: Qual é % suas decisões corretas? (assessment)
  • Training Data Preparation: Como coletar + label decisões? (data engineering)
  • DAPO Setup: Como instalar e configurar DAPO? (infrastructure)
  • Agent Fine-Tuning: Como treinar agent em suas decisões? (training)
  • A/B Testing: Como testar RL agent vs LLM-only? (validation)
  • Deployment Strategy: Como rollout gradualmente? (safety)
  • Monitoring & Alerts: Como detectar decision quality degradation? (ops)
  • Continuous Improvement: Como iterar semanalmente? (process)
  • Fraud Pattern Recognition: Como agent learns fraud patterns? (security)
  • Compliance Automation: Como enforce rules via RL? (governance)

RL Agent Training | DAPO | Decision Quality Optimization | Fraud Prevention →


Publicado em 21 de setembro de 2026

Leia também