Advanced architecture
Federated learning
Several browsers can train on their own rows and send only a weight update. Press Train. Three simulated browsers take a local step, the page averages the weights, and the loss chart updates. No browser outside this tab takes part.
Example data, not real traffic.
Real federated learning needs devices, a secure average, and a limit on what an update can reveal. This chart is a local simulation.
Understanding the labHow to use it and why you'd want to
Why you'd want to
You want the average of local updates without pooling the rows. Press Train and watch the loss fall on these simulated browsers.
How to use it
- Read the three simulated browsers.
- Press Train once and read the new weight.
- Follow the loss line across rounds.
Loading the lab…
WalkthroughHow we built itShowHide
Example vendor setup is marked below. eVar and event numbers are examples. This lab does not call Adobe.
federatedRounds lets each simulated browser take one gradient step, then replaces the weight with the average. lossAt is the mean squared error on the local rows. No request leaves the page.
Give each browser its own rows
FED_CLIENTS holds three tiny x and y lists. They stand in for browsers that are not connected.
Step locally
clientStep moves the shared weight by the mean gradient of that browser's rows.
Average and plot
The server weight is the mean of the three updates. The chart plots lossAt at each round.
From the code
One local step, then the rows stay put.
return weight - lr * (gradient / client.xs.length)The server keeps the average update.
weight = updates.reduce((sum, value) => sum + value, 0) / updates.lengthGoogle and Adobe
Google queues advanced_lab_view after Accept. Adobe is an example of the same fields.
After Accept, this lab queues advanced_lab_view. The demo payload stays on the page. This site does not call Adobe.
Simplified shape of the object queued after Accept.
dataLayer.push({
event: "advanced_lab_view",
lab_id: "federated-learning",
})Example implementation. This site does not call Adobe. eVar169, prop169, and event169 are example variable numbers. In Launch, a data element reads the value and a rule sends it when the value changes. In the report suite, enable eVar169 with Most Recent allocation and expire it on the hit.
Example alloy payload. _example is a placeholder schema, not a real tenant.
alloy("sendEvent", {
xdm: {
eventType: "web.webinteraction.linkClicks",
_example: {
federatedSimulated: "true",
},
},
})Example hit. eVar169 is hit-scoped in this example.
s.eVar169 = "true"
s.prop169 = "true"
s.events = "event169"
s.tl(true, "o", "advanced_lab_view")Translation
Each lab field, the GA4 name, and the example Adobe variable. Scope is the part that usually gets lost in the translation.
Lab id
GA4. Parameter lab_id on advanced_lab_view.
Adobe. Example eVar, expire on the hit.
Scope. Event. It names this lab, not the user.
Demo value
GA4. Not sent. Scores, proofs, and payloads stay on the page.
Adobe. Example prop. Do not copy the demo value.
Scope. Local state. It is not a user property.
Example counts
GA4. Not sent. Labeled example data is not a metric.
Adobe. Example event. Not sent.
Scope. A figure on the page, not a hit.
Consent
GA4. The view event is skipped until Accept.
Adobe. Example: skip the hit while consent is off.
Scope. A gate on the hit.
Recommended next
Why these picksReading path transitions…