献给阿尔吉侬的花束

为什么要读这本书呢,因为看过别人关于这本书,对其中故事的描述很是喜爱,自己想从头到尾体验一番!

这本书真的非常值得推荐。

查理的一生非常精彩,从笨蛋 到 非常聪明 到 变笨

查理对周围人的看法也会随之发生改变,不仅仅是 智慧上的变化 还有 看待周围人的角度的变化。

Read more »

宝贵的人生建议

“本书的每一条建议不一定都对你有意义,但我相信很多是有的。本书就像一个压缩文件,你可以解压缩,从中发现更多宝贝。”

Read more »

Attention

长时间专注在一件事情上,直到把它完成的能力。

Read more »

basic Model

-B military

生成的故事的背景 是 军事

–cond_text

故事的开头词语,后面的内容 会在此基础上展开

–length

设置故事的长度

–gamma 1.5

这个故事中 关于 军事元素 更突出

–num_interations

回顾每个句子3次,确保他们贴合 主题

设置越大,迭代次数越多。消耗资源多。

__num_samples

想要得到10个不同的故事

一个 没有使用监督 生成的 文本内容

和 10个 收到干扰 生成的不同风格的文本

nginx

Nginx is a lightweight web server and reverse proxy server. It is widely used in Internet projects because of its small memory usage, extremely fast startup, and high concurrency capabilities.

Read more »

python

1
pyenv versions

创建虚拟环境

1
python3 -m venv envp1

进入环境

1
source nvpl/bin/activate

安装依赖

source env1/bin/activate

1
pip install -r requirements.txt

修改zshrc文件

1
open ~/.zshrc
1
source ~/.zshrc

虚拟环境

退出虚拟环境

1
deactivate

mysql

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
42
43
brew install mysql@5.7
==> Downloading https://formulae.brew.sh/api/formula.jws.json
###################################################################################################### 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
###################################################################################################### 100.0%
Warning: mysql@5.7 has been deprecated because it is not supported upstream!
==> Downloading https://ghcr.io/v2/homebrew/core/mysql/5.7/manifests/5.7.44_1
Already downloaded: /Users/zhouzhenzhou/Library/Caches/Homebrew/downloads/9f6ae88b4c3f3af0a19550d0e3f7f6b02975ebe97f2dbe346dfd0479fa942120--mysql@5.7-5.7.44_1.bottle_manifest.json
==> Fetching mysql@5.7
==> Downloading https://ghcr.io/v2/homebrew/core/mysql/5.7/blobs/sha256:ca2e5c8b98bd92843578ffeae0e6280d3066a
Already downloaded: /Users/zhouzhenzhou/Library/Caches/Homebrew/downloads/7d6f51b25d6589ae36b113cfc49567c965848b0d61ab5efe2036b77a38200c24--mysql@5.7--5.7.44_1.arm64_sonoma.bottle.tar.gz
==> Pouring mysql@5.7--5.7.44_1.arm64_sonoma.bottle.tar.gz
==> Caveats
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation

MySQL is configured to only allow connections from localhost by default

To connect run:
mysql -uroot

mysql@5.7 is keg-only, which means it was not symlinked into /opt/homebrew,
because this is an alternate version of another formula.

If you need to have mysql@5.7 first in your PATH, run:
echo 'export PATH="/opt/homebrew/opt/mysql@5.7/bin:$PATH"' >> ~/.zshrc

For compilers to find mysql@5.7 you may need to set:
export LDFLAGS="-L/opt/homebrew/opt/mysql@5.7/lib"
export CPPFLAGS="-I/opt/homebrew/opt/mysql@5.7/include"

For pkg-config to find mysql@5.7 you may need to set:
export PKG_CONFIG_PATH="/opt/homebrew/opt/mysql@5.7/lib/pkgconfig"

To start mysql@5.7 now and restart at login:
brew services start mysql@5.7
Or, if you don't want/need a background service you can just run:
/opt/homebrew/opt/mysql@5.7/bin/mysqld_safe --datadir\=/opt/homebrew/var/mysql
==> Summary
🍺 /opt/homebrew/Cellar/mysql@5.7/5.7.44_1: 321 files, 235.7MB
==> Running `brew cleanup mysql@5.7`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

数据库

1
brew services start mysql

Poster: FrameBlending in LLM

BackGround

Problem

For the current Large Language Model, it can be used to solve the most general problems. But when it comes to the integration of two specific different themes, sometimes the new content generated is a pile of vocabulary.

The Large Language Model is like a huge library that contains books and knowledge on various topics. How to find the needed topics in this library and integrate these contents together, rather than simply piling up information, and ensure their consistency in style and narrative.

The existing problems are as follows:

  1. The generated content is not smooth and natural enough.

  2. The generated text, although smooth and natural, is not true to the source of the content (intrinsic problem) and/or is uncertain (extrinsic problem). This is usually caused by insufficient information given by the context.

Approches

  1. Increase the granularity through fine tunning, and select a more suitable connection word as the fusion point for fusion.

​ 1.1 Find the connected keywords of these two different frames

​ 1.2 Find connected words based on keywords in different frames

​ 1.3 Generate different content based on two frames based on connected words

​ 1.4 Integrate different contents generated based on connected words

image-20240407150622906

Data Sources: AG’s corpus of news articles

Link: http://groups.di.unipi.it/~gulli/AG_corpus_of_news_articles.html

目前建议数据库主要有10主题

分别是

computers, fantasy, kitchen, legal, military, politics, positive_words, religion, science, space.

我们可以输入两个 关于 上面10个frame topic 里面的两个 进入融合,然后对比

  1. 利用现有的大语言生成模型,通过插入额外的模型 or 代码 来调整生成的内容。

引入额外的基础模型来强化基础语言模型,改善生成文本的质量。

这个引入的基础模型的功能:

  1. 改善 主题 一致性

    找到 两个不同frame之间关联词,在关联词的基础上进行生成。

  2. 提升 文本的连贯性

    明确输入的大纲,使用连接词 和 过渡词 为LLM提供足够的上下文。

  3. 对 LLM的生成内容进行方向性调整

    对于LLM来说,即便是输入内容的一点改进,也会导致输出内容变化,我们可以利用这一点,尝试让LLM生成特定方向的内容,并根据生成的内容改进 调试LLM的输入参数,从而让LLM的输出内容更接近我们想要的结果。

image-20240407151424369

OutComes

show cases

image-20240407033248934

Figure 1: An example of the Frame Blending System automatically suggesting Frame blends for the inputs of Jurassic Park and Sport Shoes. The system first expands both inputs into associations, then finds connections between the associations.

Conclusions

我的目前 通过在大语言模型 前面增加 新的 框架,这个框架 允许 人类更进一步 控制所要 生成的故事主题。这个框架会和大语言生成模型一起工作,通过 控制生成志向特定的方向,同时保证生成句子的流畅性。

设计一套系统,这套系统 可以 让人们控制 主题的改变范围,或者选择不同的侧重点来 生成新的故事。系统的重点在于 支持 不同颗粒度级别的 不同主题。 目前的系统仅 支持 四个主题,虽然可以证明该系统的可行性,但是,如何将其优化为适用于多个主题,并且广泛的应用还需要进一步的研究。

系统例子

未来提升空间

  1. 增加反馈机制,根据用户 or 自动系统 对 生成的文本进行评分,然后 基于这些分数 进一步调整 LLM的输入策略。

  2. 优化数据库,使用更高质量,更丰富的数据库来作为 调整LLM的指标。

References

Using Pytorch to Build Transformer

Read more »