Gautam Singh
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Proposal ## Modeling Word Embedding Drift From Sparse Data #### Motivation In a recommender system for online retail, in the summer, "vacation" might be associated with "swimwear" while in winter "vacation" might be associated with "skiing". Thus, by seeing the embeddings of "skiing" and "vacation", even if we have not seen "gloves" or "snow boots" that much in our datasets, we might infer from the proximity of "skiing" and "vacation" that gloves" or "snow boots" should also be close to "vacation" during winter. #### Step 1: Synthetic Dataset Creation 0. Freeze a vocabulary of 100 synthetic words. 1. Make a dataset of 1000 mini-datasets as follows. - a) Treating the words as nodes of an undirected graph create a random graph $G_1$ with each edge having a random weight. You may try to make the graph sparse by having most of the edges to be 0. - b) Make synthetic text $D_1$ using the graph by performing a random walk (based on edge weights) on the graph. - c) Sample a "drift" for the graph. (Eg. Such as changing the weight of one of the edges etc.). You need to define what is a reasonable assumption of drift. - d) This will give you a drifted graph $G_2$. - e) From $G_2$, make a synthetic dataset $D_2^\text{small}$ but containing only 50 out of 100 words. - f) Similarly, make a fuller dataset $D_2^\text{full}$ but this time containing all the 100 words. - g) Keep 800 for training, 100 for validation and 100 for testing. #### Step 2: Estimate Drift For each mini-dataset: 2. Train word embedding $E_1^\text{full}$ using $D_1$. 3. Train word embedding $E_2^\text{small}$ for the 50 words using $D_2^\text{small}$ 4. Train word embedding $E_2^\text{full}$ for all the words using $D_2^\text{full}$. 5. Using drift in the embeddings of the 50 words i.e. from $E_1^\text{small}$ to $E_2^\text{small}$ as input, try to predict the embedding $E_2^\text{full}$ as learning targets. You may use any neural net or more recent architectures like transformer. - a) Look up a simple implementation of transformers. Play with it. - b) In a nutshell, transformer takes a set input and returns a set output. And each output prediction depends on all the inputs in a non-linear way $$ y_{1:T} \leftarrow \text{Transformer}(x_{1:T}) $$ So if there are T inputs, there will be T outputs, each output corresponding to one input. - c) Thus, we need to construct a set input to give to the transformer. $$ E_2^\text{small} \cup E_1^\text{full} $$ This will give M + N outputs. However, we only want N outputs. So we can ignore the M outputs and use only N of them. - d) To train, we can minimize some MSE loss with the targets $E_2^\text{full}$. #### Careful 1. Make sure that when you train $E_2^\text{small}$ and $E_2^\text{full}$, they are aligned with $E_1^\text{large}$. Otherwise, due to random seed effects, there may be no clear pattern for us to predict $E_2^\text{full}$ from $E_1^\text{full}$. May be this alignment is not needed in case Transformer figures out that such randomness can exist. 2. Alignment can be ensured by taking $E_1^\text{full}$ as initializations when training word-embeddings for $E_2^\text{full}$ and $E_2^\text{small}$. <!-- $$ \mathcal{V}_\text{partial} = w_{1:M}\\ \mathcal{V}_\text{whole} = w_{1:N}\\ $$ $$ e_{1:N}^{D_1^\text{large}}\\ e_{1:M}^{D_2^\text{small}}\\ e_{1:N}^{D_2^\text{large}} $$ --> <!-- ## Modeling Word-Embedding Drift from Sparse Data <!-- Given : $$ x_{1:N, t} $$ where $N$ is the vocabulary size. Generative Model: $$ p(x_{1:N, t} | x_{1:N, t-1}) = p(x_{1:N, t}|x_{1:N, t-1}, z_{t-1,t}) p(z_{t-1,t}|x_{1:N, t-1}) \\= \big[\prod_{n=1}^N p(x_{n, t}|x_{n, t-1}, z_{t-1,t}) \big]p(z_{t-1,t}|x_{1:N, t-1}) $$ Inference step : $$ q(x_{M:N, t} | x_{1:N, t-1}, x_{1:M-1, t}) $$ --> <!-- Main Idea : --> <!-- ###### Main Idea - At every time-step, we receive only little data which do not use all words in variety of contexts. - By adjusting the word embedding based on estimated drift, we should be better able to prevent performance drop over time. - --> <!-- ###### Method Training time, $$ e = \text{Transformer}(x_{1:M, t-1}, x_{1:M,t}) $$ $$ \hat{x}_{n,t} \leftarrow \text{RNN}(x_{n, t-1}, e) $$ To train, minimize the MSE loss $$ || x_{n,t} - \hat{x}_{n,t}||^2 $$ Testing Time, $$ e = \text{Transformer}(x_{1:M, t-1}, x_{1:M,t}) $$ $$ \hat{x}_{n,t} \leftarrow \text{RNN}(x_{n, t-1}, e) $$ #### Evaluation Methodology 1. We shall do a downstream task. 2. And we will evaluate how the downstream task performance loss is mitigated when we use our model is used to adjust the embedding. ###### Downstream Task Possibilities 1. Product Recommendation data temporal? 2. Sentiment 3. Toy Dataset (I prefer this!) ###### Baselines and Models 1. Use same embedding as previous time-step 2. Baseline method to adjust embedding 3. Our method ###### Metric Same as the metric of the downstream task. - For example, recommendation. nDCG - For example, sentiment classification. Accuracy --> -->

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully