Readme

Sparse autoencoder feature of the day email

This Val sends a daily notification email at the start of every day with a random high confidence (> 0.8) feature drawn from my sparse autoencoders project that tries to find interpretable directions in the latent space of embedding models.

It sends you an email with a brief description of the feature and a link to view more.

Here's an example email from this Val: Screenshot 2024-04-04 at 15.41.34.png

Every time you run it, you'll get a different feature. By default, this uses the lg-v6 model, which I think is a good one to start with, but this may change in the future as I train better feature dictionaries!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { email } from "https://esm.town/v/std/email?v=12";
const modelName = "lg-v6";
const dictionaryUrl = `https://thesephist--prism-start-app.modal.run/models/${modelName}`;
const confidenceThreshold = 0.8;
function randomlyPickFeature(featuresAboveConfidenceThreshold) {
return featuresAboveConfidenceThreshold[Math.floor(Math.random() * featuresAboveConfidenceThreshold.length)];
}
function getFeatureLink(feature) {
const { index } = feature;
return `https://thesephist--prism-start-app.modal.run/f/${modelName}/${index}?layout=2`;
}
export default async function(interval: Interval) {
const response = await fetch(dictionaryUrl);
const { features } = await response.json();
const featuresAboveConfidenceThreshold = features.filter(
feature => feature.confidence > confidenceThreshold,
);
const randomFeature = randomlyPickFeature(featuresAboveConfidenceThreshold);
const { index, label, attributes, confidence, density } = randomFeature;
const messageSubject = `Feature of the day: ${label}`;
const messageBody = [
`Today's feature is #${index}: ${label} with a confidence score of ${confidence} and a density of ${density}.`,
``,
`${attributes}`,
``,
`Read more: ${getFeatureLink(randomFeature)}`,
].join("\n");
const payload = {
subject: messageSubject,
text: messageBody,
};
console.log(payload);
void email(payload);
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
April 16, 2024