National Chengchi University
Uedu Main Site
Explore Uedu
Student Console
Register as Member/Login
Research Informed Consent Center
Survey Center
Teacher Console
Course Setup
Support & Messages
Uptime Data

UeduGPTs

--

Jupyters

6

Local AI

--

Uedu Code

--

AI Reply Desktop Notifications

Show a desktop notification when the AI TA finishes replying

Chat Message Notifications

Notify me when classmates post messages in the forum

Sound notification

Play an alert sound whenever there is a new notification

METHODOLOGY

PALM Physiologically-Aware
Language Models Methodology

Explain how Uedu integrates physiological data from Garmin wearables, using dual-baseline statistical shift detection so the AI TA can perceive learners' physical and mental state and adjust conversation strategies.

1. Overview

PALM (Physiologically-Aware Language Model) is the physiological-aware language model module of the Uedu platform, and the core implementation of the PhysioNeuromics dimension within the Educational Omics framework.

PALM’s design philosophy is to embed care within the dialogue itself, rather than through external push notifications. When a Student’s sleep, HRV, stress and other physiological indicators deviate from their personal baseline, the AI TA automatically adjusts its dialogue strategy (for example, a gentler tone and suggestions to rest), and the Student will not see any additional notifications or warnings.

2. Data sources and ETL

2.1 Data sources

At present, PALM's physiological data comes from the Garmin Connect API. Students need to authorise a Garmin account connection on the Uedu platform (Uedu Fit module), and the system will then automatically receive the wearable device's daily health summary.

2.2 ETL Pipeline

Raw JSON data pushed by Garmin is processed by the sync_garmin_to_palm_summary() function for ETL (Extract-Transform-Load) and written uniformly into the palm_health_summary data table:

PALM ETL Pipeline Garmin Connect API sleeps hrv · stressDetails dailies · userMetrics Push JSON (per day) ETL transformation Normalise fields Average Calculation for Stress / Body Battery UPSERT (no duplicates across multiple same-day sources) palm_health_summary One entry per person per day Consistent format · cross-device compatibility UK: (user_id, summary_date) Cron baseline recalculation Daily at 04:00 UTC (midday in Taiwan) 7-day + 30-day dual window palm_user_baseline AI TA System Prompt Inject physiological context

3. Physiological indicators

PALM tracks the following five categories of physiological indicators:

CategoryIndicatorSourceDescription
Sleepsleep_duration_secondssleepsTotal sleep duration (seconds)
sleep_deep_secondssleepsDeep sleep duration
sleep_light_secondssleepsShallow sleep duration
sleep_rem_secondssleepsREM sleep duration
sleep_scoresleepsGarmin sleep quality score
HRVhrv_last_night_avghrvAverage heart rate variability last night (ms)
Stressstress_avgstressDetailsAverage all-day stress level (0-100)
body_battery_avg / max / minstressDetailsBody Battery average / maximum / minimum
Activitysteps, active_calories, distancedailiesDaily steps, active calories, distance
Heart rateresting_heart_rateuserMetricsResting heart rate (bpm)

4. Dual-baseline statistical model

PALM builds a personal baseline for each user across two time windows:

ContactDaysPurposeMinimum data days
Acute baseline7 daysDetect recent acute changes ("compared with last week over the past few days")3 days
Trend baseline30 daysDetect overall drift ("compared with usual")3 days

4.1 Baseline calculation contents

Each baseline includes the following statistics (calculated for days with data within the window):

  • Average (AVG): sleep duration, sleep score, HRV, stress, Body Battery, steps, resting heart rate
  • Standard deviation (STDDEV): sleep duration, HRV, stress, Body Battery
  • Data days (days_with_data): number of days with actual data
  • Calculation range (from_date ~ to_date)

4.2 Baseline update frequency

The baseline is automatically recalculated daily by Cron Job (cron_palm_baseline.py) at 04:00 UTC every day (12:00 noon in Taiwan). This time slot is chosen because Garmin sleep data are usually fully synchronised by the morning.

5. Drift detection and classification

5.1 Z-score drift detection

When a Student is conversing with the AI TA, the system compares the current physiological data with the dual-window baseline in real time, using z-score to determine the degree of deviation:

z = (current_value - baseline_avg) / baseline_std

Based on the absolute value of the z-score, deviations are divided into three levels:

ClassificationConditionMeaning
normal|z| < 1.0Within the normal range
above_normal / below_normal1.0 ≤ |z| < 2.0Slight deviation from baseline
significantly_above / significantly_below|z| ≥ 2.0Significantly deviates from baseline

Note: some indicators are 'higher is better' (such as HRV, sleep duration, Body Battery), while others are 'lower is better' (such as stress); the system will judge whether a deviation is positive or negative based on the direction of the indicator.

5.2 Cross-window cross-check

The system calculates deviations from the 7-day and 30-day baselines respectively, then cross-checks the trend:

7-day offset30-day driftTrend judgementMeaning
AbnormalAbnormalpersistentLong-term issue, worth greater attention
AbnormalNormalacuteRecently emerged change
NormalAbnormalMay be recovering
NormalNormalnormalAll systems normal

6. AI dialogue injection

After shift detection is complete, the system assembles the physiological status summary into a piece of text and injects it into the AI TA's System Prompt. The AI TA will adjust its conversation strategy accordingly, butwill not directly display the physiological data to the Student.

6.1 Example injected content

System Prompt injection snippet (illustrative)

## Learner physiological state - Sleep: 5.2 hours last night (personal average 7.1 hours), significantly below baseline, persistent - HRV: 38 ms (personal average 45 ms), below baseline - Stress: high (72, personal average 45), acute change - Time: late night (1:30 am) Please show appropriate care for the learner's mental and physical state, and keep your tone gentle. If you notice that the Student is not concentrating or appears tired, you may suggest taking an appropriate rest.

6.2 Time context

The system determines the time period according to local Taiwan time (early morning, morning, afternoon, evening, late at night), and incorporates this into the AI's reference. For example, when a question is asked late at night, the AI may remind the Student to rest.

6.3 Graceful Degradation

When physiological data is insufficient (less than 3 days of baseline data, Student has not authorised Garmin, etc.), the PALM module will not inject any content, and the AI TA’s behaviour will be exactly the same as when PALM is not enabled.

7. Privacy and ethics

Research Ethics Notes

Physiological data are sensitive personal information. When using PALM-related data for research, informed consent from participants must be obtained, and the institution's IRB review must be passed.

  • Authorisation mechanism: the Student must actively authorise the connection to Garmin in the Uedu Fit module; the system does not collect data automatically
  • Data visibility: physiological data exists only in the back end; Students will not see their own data being referenced in dialogue
  • Withdrawal mechanism: Students may cancel Garmin authorisation at any time, and the system will immediately stop receiving new data
  • Data export: when Instructors export research data, they must comply with the platform's research ethics requirements

8. Suggested research citation

Methodology description template

The AI Teaching Assistant integrates learners’ physiological state through the PALM (Physiologically-Aware Language Model) module on the Uedu platform. Physiological data come from Garmin wearables (including sleep duration and stages, HRV, stress index, Body Battery, and resting heart rate) and are standardised and stored via an ETL pipeline in the palm_health_summary table. For each user, the system establishes dual personal baselines over 7 days (acute) and 30 days (trend); z-scores are used to detect the degree of deviation from the baseline, and deviation trends are cross-judged (acute / persistent). A deviation summary is injected into the AI System Prompt so that the AI automatically adjusts tone and strategy during conversation, but physiological data are not shown directly to Students. A minimum of 3 days of data is required to enable this feature. See the detailed methodology at https://uedu.tw/doc/palm.

It is recommended to provide the following:

  • Garmin device model used by participants
  • Data collection period and proportion of valid days
  • Informed consent form version and IRB approval number
  • Baseline window days setting (default 7 + 30 days)