Skip to main content
Back to Portfolio ProjectsBhavya Gupta · Case Study
AI / ML

CAR-SR — Continual RL Under Task Conflict

Conflict-aware orthogonal gradient projection and Parseval spectral regularization resolving the stability-plasticity trilemma in RL.

-42%

Forgetting Reduction

97.4 ± 34.3 vs 168.4 naive on partial conflict

82.8 vs 44.9

Forward Transfer Uplift

Parseval frame nearly doubles transfer vs ablation

5 algos / 63 runs

Benchmark Matrix

3 seeds × 3 conflict regimes + ablations

18 tests passed

Test Suite

Gradient projection, envs, and CRL metric proofs

Trained CAR-SR continual RL inverted pendulum agent balancing across task shifts

Live inverted pendulum (CartPole-v1) checkpoint balancing across shifted task dynamics.

The Problem

When a single fixed-capacity RL policy trains across sequential tasks with conflicting optimal actions, standard experience replay blends contradictory Bellman targets and triggers negative transfer, while Fisher regularization freezes output weights and destroys plasticity.

What I Built

Designed and benchmarked CAR-SR (Conflict-Aware Replay with Spectral Regularization) in PyTorch and Gymnasium across 63 multi-seed runs and 3 graduated conflict curricula (similar, partial, dissimilar), with automated evaluation and visualization tooling.

Technical Architecture

At every step, CAR-SR computes cosine alignment c_t between active-task gradients and reservoir replay memory gradients. When c_t < 0, active gradients are orthogonally projected onto the normal plane of replay gradients, while Parseval regularization keeps hidden weight matrices near isometric frames.

01

Graduated Conflict Curricula

No-task-ID CartPole-v1 sequences: similar, partial (x>0 flip), and dissimilar (global flip).

02

Dual-Stream Gradient Check

Measures cosine similarity c_t between active TD loss and reservoir memory loss.

03

Orthogonal Projection

Removes conflicting component when c_t < 0 so historical Bellman errors do not worsen.

04

Parseval Spectral Frame

Penalizes ||W^T W - I||_F^2 to preserve hidden rank and forward plasticity.

Verification & Key Takeaways

  • Isolated ablation studies prove orthogonal projection prevents forgetting (+63% forgetting surge without it) while Parseval preserves plasticity.
  • Reproducible CLI orchestration across parallel workers with deterministic seeding.
PyTorchGymnasiumSciPy & PandasMatplotlibPytestYAML Experiment CLI