From 4b70ff2a8bea57a2142e767bf3dfce85c050e14f Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 21 Jun 2026 12:30:19 +0100 Subject: [PATCH] [Fix] neural: default learn_from_controller off (preserve split learning) Controller learn tasks (/learnspam, /learnham) historically trained only the classifiers; neural learned from its own scan-time paths (autotrain, ANN-Train, autolearn). Default train.learn_from_controller to false so that split-learning behaviour is preserved out of the box: no NEURAL_LEARN_ learn symbol is registered by default, the learn task stays the lean classifiers-only pipeline, and learn_needs_check / the check-pass mask remain dormant. Operators opt a rule into unified learning per rule with train.learn_from_controller = true. --- lualib/plugins/neural.lua | 16 +++++++++------- src/plugins/lua/neural.lua | 8 -------- test/functional/configs/neural_learn_task.conf | 3 +++ 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/lualib/plugins/neural.lua b/lualib/plugins/neural.lua index d2a9e0ed8..68121bcf8 100644 --- a/lualib/plugins/neural.lua +++ b/lualib/plugins/neural.lua @@ -68,13 +68,15 @@ local default_options = { -- means "default to disable_symbols_input" (resolved per-rule at init); set to -- false to opt out and keep running the full pipeline for forced learns. forced_learn_minimal_scan = nil, - -- learn_from_controller: when true, a controller learn task (e.g. /learnspam, - -- /learnham) also trains this neural rule -- one corpus push feeds bayes and - -- neural. Only symbols-independent rules (disable_symbols_input) are eligible - -- (a learn task runs no rule symbol). nil means "default to - -- disable_symbols_input" (resolved per-rule at init); set to false to keep a - -- fusion rule out of the controller learn path. - learn_from_controller = nil, + -- learn_from_controller: opt-in (default false) to preserve the historical + -- split-learning behaviour -- by default a controller learn task (/learnspam, + -- /learnham) trains ONLY the classifiers, and neural keeps training from its + -- own scan-time paths (autotrain, ANN-Train, autolearn). Set it to true to + -- also train this rule from controller learn tasks, so one corpus push feeds + -- bayes and neural. A disable_symbols_input rule then trains from the lean + -- learn pipeline; a symbol-dependent rule makes its learn task run a full + -- check pass first (its vector reads symbol scores). + learn_from_controller = false, }, watch_interval = 60.0, lock_expire = 600, diff --git a/src/plugins/lua/neural.lua b/src/plugins/lua/neural.lua index 492f73e2b..699484992 100644 --- a/src/plugins/lua/neural.lua +++ b/src/plugins/lua/neural.lua @@ -1789,14 +1789,6 @@ for k, r in pairs(rules) do rule_elt.train.forced_learn_minimal_scan = rule_elt.disable_symbols_input and true or false end - -- learn_from_controller defaults ON for symbols-independent rules (so a - -- /learnspam corpus push trains them alongside bayes) and OFF otherwise. - -- Operators can set it to false to keep a fusion rule out of the controller - -- learn path. - if rule_elt.train.learn_from_controller == nil then - rule_elt.train.learn_from_controller = rule_elt.disable_symbols_input and true or false - end - if not rule_elt.profile then rule_elt.profile = {} end diff --git a/test/functional/configs/neural_learn_task.conf b/test/functional/configs/neural_learn_task.conf index fd3c18119..e757fdc22 100644 --- a/test/functional/configs/neural_learn_task.conf +++ b/test/functional/configs/neural_learn_task.conf @@ -53,6 +53,9 @@ neural { max_trains = 1; max_iterations = 250; classes_bias = 0.0; + # opt into controller learning (off by default to preserve the + # historical split-learning behaviour). + learn_from_controller = true; } symbol_spam = "NEURAL_SPAM_SHORT"; symbol_ham = "NEURAL_HAM_SHORT";