# User Persona Identification and New Service Adaptation Recommendation

Narges Tabari<EMAIL_ADDRESS>AWS AI LabsSanta ClaraCAUSA ,  Sandesh
Swamy<EMAIL_ADDRESS>AWS AI LabsSeattleWAUSA and  Rashmi Gangadharaiah
<EMAIL_ADDRESS>AWS AI LabsSanta ClaraCAUSA

###### Abstract.

Providing a personalized user experience on information dense webpages helps
users in reaching their end-goals sooner. We explore an automated approach to
identifying user personas by leveraging high dimensional trajectory
information from user sessions on webpages. While neural collaborative
filtering (NCF) approaches pay little attention to token semantics, our method
introduces SessionBERT, a Transformer-backed language model trained from
scratch on the masked language modeling (mlm) objective for user trajectories
(pages, metadata, billing in a session) aiming to capture semantics within
them. Our results show that representations learned through SessionBERT are
able to consistently outperform a BERT-base model providing a 3% and 1%
relative improvement in F1-score for predicting page links and next services.
We leverage SessionBERT and extend it to provide recommendations (top-5) for
the next most-relevant services that a user would be likely to use. We achieve
a HIT@5 of 58% from our recommendation model.

††ccs: Computer systems organization Embedded systems††ccs: Computer systems
organization Redundancy

##  1\. Introduction

Automatically identifying and determining a user’s preferences on a webpage is
an important step towards building personalized systems that satiate a user’s
business needs. A user’s journey through a website can be emitted in the form
of session-based information consisting of atomic semantic units such as the
title of the page clicked, the text content of a button that was clicked, text
within help articles, location information, billing information, and so on.
Leveraging such semantic information through the course of a user’s journey
can give us valuable insights into their preferences.

Depending on the complexity of tasks, user sessions will span anywhere from a
few minutes to several hours filled with actions necessary to reach a desired
goal. User facing interfaces tend to consist of dynamically generated widgets
such as Recently Visited, System Health, and Explore new services.
Recommending the right widget, along with personalized content will help users
to explore the right services and functionalities to arrive at their end task
much sooner. As an added bonus, this allows users to adopt previously unknown
capabilities, thereby ensuring a smoother user experience. As a first step
towards achieving this, we explored the idea of assigning Personas111Using
user survey data, seven different personas were defined for our users. Each
persona was assigned a set of tasks as their main activity. These seven
personas share tasks between each other, and have a distinct set of tasks that
is only assigned to them. For example, Persona 1 has monitoring as one of its
tasks, compared to Persona 2 that contains cost management as one of their
core tasks, however, both of them share exploration of new services as their
tasks as well. For anonymity, we name these personas Persona 1 to 7.  to our
users through Persona Identification where we detect existing and emerging
user personas on the website. We leverage techniques from Natural Language
Processing (NLP) and language modeling (LM) (Martin, 2023) to incorporate
semantics and context into our model in the form of user journeys consisting
of page titles, location data, and billing information. LMs in general can
give personalized recommendations corresponding to historical behaviors.
Obtaining a persona helps understand a user’s intention, generate a user
profile for each of them, and be able to provide proactive personalized
experiences and recommendations. Our recommendation engine recommends a
personalized list of top 5 services previously unexplored by users.

The goal of persona identification is to segment users based on their
activities on the user interface. To assign users to different segments, we
need to learn representations that can succinctly summarize the user’s
behavior. Due to lack of labeled data, we approach persona identification in
an unsupervised setting consisting of 3 stages. First, we generate activity-
based, semantic session representations using the click stream data.Motivated
by language models leveraged in NLP applications (Wu et al., 2022), we
introduce SessionBERT, a pre-trained Transformer-backed language model trained
from scratch that takes advantage of semantic information in text such as user
interface clicks, geo-location, billing, and different activity features to
understand a user behavior. We train the model with the same Masked Language
Modeling optimization, but we mask a user’s session information in our
approach. The resulting model is further fine-tuned in a multi-task setting in
order to evaluate the quality of learned representations along with their
prediction power on the last service and last page prediction in each session
sequence. Second, we group users based on the learnt session embeddings from
SessionBERT. Finally, using high-level descriptions of personas defined
through user surveys, we map the clustered groups to personas.

For new service recommendation, we used the SessionBERT model and fine-tuned
it on service and page prediction tasks. The goal of this recommendation is
for users to adapt a new service that they have not used before. We show that
SessionBERT fine-tuned on service prediction and ranking recommendations based
on the number of times it is recommended is able to provide contextual
recommendation to users. We deploy all our models using Sagemaker pipelines
and use p3.2xlarge instances to host. We use dynamic widgets placed on user
homepages to surface service recommendations.

Our main contributions are:

  * •

SessionBERT: We introduce SessionBERT, a pre-trained Transformer based
language model, trained from scratch on user session activities on a webpage.
The proposed approach provides a substantial gain of 29% relative for service
prediction and 32% relative for page prediction (for sequence length of 64)
and 1% relative for service and 3% relative for page prediction in F1-measure
(for sequence length of 512) over the BERT-base model.

  * •

User Persona Identification: We present a method to create user personas using
the representations from SessionBERT through three phases: building session
representations, user segmentation, and persona mapping.

  * •

New Service Recommendation: We show that SessionBERT fine-tuned on service
prediction and ranked based on most services recommended has 93.1% accuracy
and can provide contextualized recommendation tailored to user history and
their persona.

##  2\. Related Work

One of the main challenges in personalization is to generate appropriate
content for each user in order to assist them and gain trust (Zheng et al.,
2019). Existing personalized language models can be classified into two kinds:
explicit and implicit personalization (Zheng et al., 2020). Explicit
personalization models introduce profiles and personal intersests such as
gender, and expertise into language models to generate personalized responses.
On the other hand, implicit personalization models extract persona profiles
using user’s activities and all their historical actions which is our focus.

Research around developing implicit personalization models and systems on
user-specific textual and session content is under-explored. A natural
approach used in recent years has been to train a language model for each
user, based on their historical activities(Oba et al., 2019), (Wu et al.,
2022). For example, (Oba et al., 2019) proposed a personalized review
generation model by considering different reviewers and their style and choice
of vocabulary. Or (Zhang et al., 2019) first pre-trained a general response
generation model on large-scale conversational data, and then personalized the
responses to user’s preferences by tuning the model on their personal
conversation data.

User modeling, especially with goal of recommendation is a fundamental
approach for implicit personalization tasks such as personalized news (Okura
et al., 2017), or item recommendation (Sun et al., 2019). Most of the existing
user modeling techniques rely on labeled data (Yuan et al., 2020) for training
accurate models. Motivated by pre-trained language models in NLP, these
applications pre-train self-supervised models on user behavior data and fine-
tune its parameters on the desired downstream tasks such as item
recommendation (Wu et al., 2022), (Huang et al., 2020). Most of implicit
personalization models, however, either have been focused on specific
application such as dialog systems, or in a more general way, they usually
aggregate all user behavior data in one single data sample (Wu et al., 2022).
Most recently, there are some groundwork attempts that uses Large Language
Models (LLMs) for solving item recommendation tasks (Wang et al., 2023; Wang
and Lim, 2023). However, these models are very costly to train and are not
suitable for low latency requirements of our work. Our work leverages LMs to
generate user representations, provide user segmentations, and provide
recommendations.

##  3\. Data

Figure 1. Sample data point used in training of SessionBERT.

When users interact with a web interface, they eventually look to navigate to
pages that help them achieve their goal (in our case, service pages).
Predicting and recommending next pages to visit helps reduce time spent on the
website while providing the benefit of introducing users to new services. A
user’s session history helps generate representations which capture
personalized features such as a user’s past transactions, pages visited,
billing information (_Low_ , _Medium_ , _High_ , and _Very High_), and
geographical locations. For our experiments, we gathered 9MM session
trajectory information. We split the dataset into 5.9MM:1.9MM:1.1MM sessions
for train:validation:test sets respectively.

These sessions include services, pages, and subpages that each user navigated
to reach their goal. Our model for learning user’s representations is trained
by flattening their session history into a sequence of _service;page_
combinations. Each activity is separated by [SEP] token. Additionally, we add
user billing information, and geo-location as context to our session sequence.
Figure 1 provides a sample for the data that acts as input to our models.

##  4\. Model

For all experiments we use 4 NVIDIA Tesla V100 GPUs. All models run for 3
epochs with learning rate of $2\mathrm{e}{-5}$. For pre-training we masked 15%
of tokens in the user trajectories.

###  4.1. SessionBERT

Using data from Section 3, we trained a tokenizer (vocabulary size of 30k) on
user’s session information which is then used to train a BERT model (Devlin et
al., 2019) using Masked Language Modeling (MLM) loss but optimizing the model
to be able to predict missing web/service pages instead. Additional tokens
were added when creating the vocabulary which help separate different sections
of a training instance such as _[activity]_ for sequence of service;page
combination, _[daily_page_token]_ for daily visited pages, _[location_token]_
for country and city section, _[daily_service_token]_ for daily visited
service pages, _[daily_billed_token]_ for daily most billed services, and
_[monthly_billed_token]_ for monthly most billed services.

###  4.2. User Segmentation

Figure 2. Elbow method results for SessionBERT (left) and Bert-base (right)
embedding for number of clusters K = 3 to 9. The Blue line is Silhouette score
and green is run-time.

Using the embeddings obtained from SessionBERT, we segmented session
representations using K-means (Hartigan and Wong, 1979) clustering using
cosine similarity as our distance metric. To determine the number of clusters
and to additionally evaluate SessionBERT embeddings, we experimented with
different values of $k$ ($k=3-9$) for both BERT-Base (Devlin et al., 2019),
and SessionBERT and calculated the silhouette score (Pet, 1987) for each run.

As shown in Figure 2, the silhouette score for SessionBERT outperforms BERT-
Base for all values of $k$. Additionally, by looking at the plot for
SessionBERT we can observe that $k=4$ is an appropriate number of clusters for
segments in our data.

###  4.3. Mapping clusters to pre-defined personas

On obtaining segments ($k=4$) as described in Section 4.2, we perform a
mapping of each segment to one or more pre-defined personas ($7$ in number).
First, we manually mapped the set of top-200 activities performed by all users
on the webpage to pre-defined persona tasks. An _activity_ is defined as a
combination of [service:page] states that a user visits through the course of
different sessions. Eg: the activities ”service1;page10” and ”service6;page14”
is mapped to the task Setup Environment. We then identified the top ten
activities performed in each cluster. The earlier mapping helped determine the
personas captured by each of the clusters.

#### Embedding of personas and clusters given tasks

To map pre-defined personas to clusters, we generated a one-hot encoding for
each persona as follows: we set the dimension $d$ of the embedding to be the
total number of identified tasks. Then for each persona we edit the encoding
to $1$ if a task exists in a persona definition. A similar encoding was
formulated for each cluster, but for each task’s index, we calculated
probability of each persona’s task being used in each cluster using the
following formula:

$p(task_{i}|cluster_{k})=\frac{num(task_{i},cluster_{k})}{\sum_{j}num(task_{i},cluster_{j})}$

Using these probabilities, for each $cluster_{k}$, an embedding was created
that if a persona task exists in that cluster, then the probability of that
task was assigned at the index. The probability distribution of clusters being
assigned to a specific persona was calculated as follows:

$(cluster_{k},persona_{i})=cluster_{k}\quad.\quad persona_{i}$

and the persona with maximum probability was picked for the cluster as its
persona tag.

$p(cluster_{k}|persona_{i})=\max(\sum_{k}(cluster_{k},persona_{i}))\\\ \forall
i:0,1,2,3$

The final mapping of personas and clusters are presented in Table 1. For every
new user at inference time, the distance between their session’s embeddings
(as computed by SessionBERT) and the cluster centroids was calculated and the
closest cluster (persona) was assigned.

As observed in Table 1, for cluster 2 there were two different personas that
could be assigned. We merged these two personas and assigned both to a single
cluster. Additionally, persona 6 and 7, had extremely low probability of being
assigned to any cluster. Therefore, it was evident that there was not enough
signal in session activity for them.

Table 1. Personas mapped to each cluster. Cluster | Persona
---|---
0 | Persona 1
1 | Persona 3
2 | Persona 2 and Persona 4
3 | Persona 5

###  4.4. Human Evaluation of Personas

To evaluate the quality of the personas assigned to users based on our models,
four annotators were given 179 sessions that were mapped with the personas
inferred. Annotators were tasked to pick an annotation for each from the
following labels: Match, Not_matched, and Unclear. We found that across all
persona clusters, in 74.25% of the instances, all annotators agreed that the
persona is appropriately assigned to the user session data. The details about
human evaluation is included in Appendix A.

###  4.5. New Service Recommendation

We leverage representations learnt from SessionBERT to provide next service
recommendations to users. To evaluate our model’s ability in providing
recommendations, we used the last activity (service and page) of each session
as the ground truth labels to be predicted for each session sequence. As a
baseline, we fine-tuned the BERT-Base model (Devlin et al., 2019) on service
and page prediction task using a multi-task setting.

Our results in Table 2, show that SessionBERT fine-tuned on next service and
page prediction outperforms Bert-base on both tasks. The label space for
recommending new pages ($2288$) is much larger than that of services ($190$)
which explains the difference in performance. To proactively recommend new
services to a user, we store their last eight sessions on a given day. (We
determined that 8 sessions had to be used as context for recommendation via a
human evaluation study which can be found in Appendix B).

During inference, the top-5 service recommendations were calculated for each
user from our SessionBERT model and if a service was already used by a user,
it was filtered out. Finally, the top 5 new service recommendations was
calculated based on the number of times they were recommended to them in our
system. We picked number of occurrence of a new service as our ranking
algorithm based on a human evaluation study explained in Appendix C .

Table 2. Multitask learning comparison on SessionBERT and BERT | Service prediction head | Page prediction head
---|---|---
Model | F1-measure | Accuracy | F1-measure | Accuracy
BERT-Base | 0.924 | 0.923 | 0.730 | 0.720
SessionBERT | 0.932 | 0.931 | 0.753 | 0.730

##  5\. Ablation Studies

Sequence Length: We varied the length of session sequences provided as context
to our models. As longer spans of information is passed to SessionBERT and
BERT-Base, we found that the model performance also improved. Regardless of
the length picked, SessionBERT consistently outperforms BERT-Base. It takes
10-fold decrease in fine-tuning time for sequence length of 64 compared to
512, and so therefore SessionBERT is especially helpful when limited
computational resources exists as the results for SessionBERT compared to
BERT-Base for length 64 is more pronounced. SessionBERT provides an
improvement of 29% relative for service prediction and 32% relative on page
prediction on F1-measure for sequence length of 64. Table 3 and Table 4 show
all the results for this experiment.

Table 3. Service Prediction: Study of session sequence length. Numbers shown here are F1-measure.  | 64 | 128 | 512
---|---|---|---
BERT-Base | 0.63 | 0.90 | 0.920
SessionBERT | 0.818 | 0.923 | 0.931
Table 4. Page Prediction: Study of session sequence Length. Numbers shown here are F1-measure. | 64 | 128 | 512
---|---|---|---
BERT-Base | 0.368 | 0.628 | 0.72
SessionBERT | 0.488 | 0.704 | 0.73

Multitask learning vs separate training: To measure the impacts of training
regimens, we focused on multitask learning setting versus separate fine-tuning
for service prediction and page prediction. As shown in Table 5, we observed
that both SessionBERT and BERT-Base benefited from the multitask learning
approach on both service and page prediction.

Table 5. Multitask learning vs Separately Training | Service prediction | Page prediction
---|---|---
Model | F1 | Accuracy | F1 | Accuracy
BERT-Base Multitask | 0.924 | 0.923 | 0.730 | 0.720
BERT-Base Service | 0.901 | 0.89 | - | -
BERT-Base Page | - | - | 0.70 | 0.686
SessionBERT Multitask | 0.932 | 0.931 | 0.753 | 0.730
SessionBERT Service | 0.893 | 0.892 | - | -
SessionBERT Page | - | - | 0.702 | 0.688

SessionBERT recommendation for each Persona category:

In this experiment, the goal was to check if the recommendations from
SessionBERT is personalized towards users based on their personas. For three
personas with the most data, we randomly selected 10 users each. These users
were assigned a persona by our model with more than 80% probability. Then for
each user in each persona category, we calculated the top-5 recommendations.
We found that for the new service recommendations for users in different
persona categories, 78% of the times the services were tailored and specific
to the task description of their persona. For example, Persona 1 has
“monitoring” as one of their tasks and all 5 users’ recommendations contained
new services that help users perform that task.

Conversion Rate for SessionBERT recommendations: To evaluate the quality of
[service;page] recommendations provided by our SessionBERT model, we picked
historical data spanning two months for a set of randomly selected users (44k
users in total). We split the data into “seen” and “unseen” partitions based
on the number of days (6, 10, and 12 days for “seen” data). By using the
“seen” partition as historical context, we used our SessionBERT to obtain
recommendations for future services. We filter out recommended services that
have already been adopted by users previously. Using the “unseen” partition of
our data, we compute the set of services which were eventually adopted by
users and compare it with recommendations made using SessionBERT to indicate
how often the recommended services are appropriate.

Table 6. Results of Hit@N experiments for new service adaptation | Hit@5 | Hit@3
---|---|---
6 Day split | 0.54 | 0.42
10 Day split | 0.58 | 0.39
12 Day split | 0.55 | 0.32

Our results in Table 6 show that a split at 10 day “seen” context provides
sufficient contextual clues for our models to perform well on a held-out
“unseen” split. Additionally, we can see that when more data is included in
the “unseen” section of data, it is more likely for the model to predict and
recommend more relevant new services. SessionBERT is able to predict new
service adaptation with Hit Rate of 58% for a 10 day “seen” split for Hit5.

##  6\. Conclusion and Future Work

In this work, we presented a new approach to persona identification and new
service and page recommendation for users as part of user-personalized
experiences using Transformer-based techniques which leverage Masked Language
Modeling (MLM) for recommendations. These personas can be used to recommend
services, content, links or pages to users that would help them to achieve
their goal faster. Our approach allows accurate mapping of user trajectory
data to a set of pre-defined personas in an unsupervised fashion. We show that
our proposed SessionBert model consistently outperforms BERT-base in service
and page prediction tasks.

## References

  * (1)
  * Pet (1987) 1987\.  Silhouettes: A graphical aid to the interpretation and validation of cluster analysis.  (1987).  arXiv:ISSN 0377-0427 https://doi.org/10.1016/0377-0427(87)90125-7.
  * Devlin et al. (2019) Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019.  BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In _Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers)_. Association for Computational Linguistics, Minneapolis, Minnesota, 4171–4186.  https://doi.org/10.18653/v1/N19-1423
  * Hartigan and Wong (1979) J. A. Hartigan and M. A. Wong. 1979.  A k-means clustering algorithm.  _JSTOR: Applied Statistics_ 28, 1 (1979), 100–108.
  * Huang et al. (2020) Xin Huang, Ashish Khetan, Milan Cvitkovic, and Zohar S. Karnin. 2020\.  TabTransformer: Tabular Data Modeling Using Contextual Embeddings.  _CoRR_ abs/2012.06678 (2020).  arXiv:2012.06678 https://arxiv.org/abs/2012.06678
  * Martin (2023) Daniel Jurafsky & James H. Martin. 2023\.  In _Speech and Language Processing_.
  * Oba et al. (2019) Daisuke Oba, Naoki Yoshinaga, Shoetsu Sato, Satoshi Akasaki, and Masashi Toyoda. 2019\.  Modeling Personal Biases in Language Use by Inducing Personalized Word Embeddings. In _Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers)_. Association for Computational Linguistics, Minneapolis, Minnesota, 2102–2108.  https://doi.org/10.18653/v1/N19-1215
  * Okura et al. (2017) Shumpei Okura, Yukihiro Tagami, Shingo Ono, and Akira Tajima. 2017\.  Embedding-Based News Recommendation for Millions of Users. In _Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining_ (Halifax, NS, Canada) _(KDD ’17)_. Association for Computing Machinery, New York, NY, USA, 1933–1942.  https://doi.org/10.1145/3097983.3098108
  * Sun et al. (2019) Fei Sun, Jun Liu, Jian Wu, Changhua Pei, Xiao Lin, Wenwu Ou, and Peng Jiang. 2019.  BERT4Rec: Sequential Recommendation with Bidirectional Encoder Representations from Transformer. In _Proceedings of the 28th ACM International Conference on Information and Knowledge Management_ (Beijing, China) _(CIKM ’19)_. Association for Computing Machinery, New York, NY, USA, 1441–1450.  https://doi.org/10.1145/3357384.3357895
  * Wang and Lim (2023) Lei Wang and Ee-Peng Lim. 2023.  Zero-Shot Next-Item Recommendation using Large Pretrained Language Models.  arXiv:2304.03153 [cs.IR]
  * Wang et al. (2023) Wenjie Wang, Xinyu Lin, Fuli Feng, Xiangnan He, and Tat-Seng Chua. 2023.  Generative Recommendation: Towards Next-generation Recommender Paradigm.  arXiv:2304.03516 [cs.IR]
  * Wu et al. (2022) Chuhan Wu, Fangzhao Wu, Tao Qi, and Yongfeng Huang. 2022\.  UserBERT: Pre-Training User Model with Contrastive Self-Supervision. In _Proceedings of the 45th International ACM SIGIR Conference on Research and Development in Information Retrieval_ (Madrid, Spain) _(SIGIR ’22)_. Association for Computing Machinery, New York, NY, USA, 2087–2092.  https://doi.org/10.1145/3477495.3531810
  * Yuan et al. (2020) Fajie Yuan, Xiangnan He, Alexandros Karatzoglou, and Liguang Zhang. 2020.  Parameter-Efficient Transfer from Sequential Behaviors for User Modeling and Recommendation. In _Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval_ (Virtual Event, China) _(SIGIR ’20)_. Association for Computing Machinery, New York, NY, USA, 1469–1478.  https://doi.org/10.1145/3397271.3401156
  * Zhang et al. (2019) Wei-Nan Zhang, Qingfu Zhu, Yifa Wang, Yanyan Zhao, and Ting Liu. 2019.  Neural Personalized Response Generation as Domain Adaptation.  _World Wide Web_ 22, 4 (jul 2019), 1427–1446.  https://doi.org/10.1007/s11280-018-0598-6
  * Zheng et al. (2019) Yinhe Zheng, Guanyi Chen, Minlie Huang, Song Liu, and Xuan Zhu. 2019.  Personalized Dialogue Generation with Diversified Traits.
  * Zheng et al. (2020) Yinhe Zheng, Rongsheng Zhang, Minlie Huang, and Mao Xiaoxi. 2020\.  A Pre-Training Based Personalized Dialogue Generation Model with Persona-Sparse Data.  _Proceedings of the AAAI Conference on Artificial Intelligence_ 34 (04 2020), 9693–9700.  https://doi.org/10.1609/aaai.v34i05.6518

##  Appendix A Human Evaluation on Personas

We performed human evaluation on result of Persona identification. If the
Persona detected by our model was labeled as match by all of our annotators,
then we count that as True Positive result of our model, otherwise they were
counted as False Negative. Accuracy, Sensitivity, and Specificity were
claculated based on TP and FN results. Detailed result of human evaluation per
persona is shown in Table 7:

Table 7. Human Evaluation of session activity on different Personas.  | Accuracy | Sensitivity | Specificity
---|---|---|---
Persona 1 | 0.73 | 0.78 | 0.21
Perona 3 | 0.68 | 0.70 | 0.29
Persona 2 and 4 | 0.86 | 0.88 | 0.11
Persona 5 | 0.70 | 0.88 | 0.11

##  Appendix B Choice of 8 recent sessions

SessionBERT as a Language Model, can give personalized recommendations
corresponding to historical behaviors. At inference time, we provide top-5
service recommendations based on the last session activities of the user. It
is important to determine the minimum number of sessions that is appropriate
for generating accurate recommendations. For this purpose, we ran experiments
on 2 months of data on users with more than 5 sessions per day.

Figure 3. This plot shows the number of times each category was picked by
annotators as better recommendation.

For each user, we get their last 3, 5, 8, 10, 12, 15 sessions, and for each
session, we inferred top 5 service recommendations, and disregarded the used
services for each user. The remaining new services based on last sessions
where then manually annotated (not only in terms of quality but also in terms
of number of services provided). The result of annotation presented in Figure
3. Based on this figure $X=8$ or $X=10$ could both be a good option. Since we
want to store the least amount of data as possible, while providing a good
quality of recommendation, we chose $X=8$ as our number of historical sessions
to continuously store to provide recommendations per user.

##  Appendix C Ranking Approaches Human Evaluation

After SessionBERT provides a list of recommendations of new services for each
user, the goal is to pick and provide the top 5 new services that is most
likely for that user to adapt. For this reason, we performed human evaluation
on a randomly selected sample of 50 user session data. For each user, the
information of all the services that user has adapted was included. rec1,
rec2, and rec3 were results of three different types of ranking algorithms.
Three annotators were asked to annotate each sample based on the following:

  * •

1: rec1 is a better recommendation

  * •

2: rec2 is a better recommendation

  * •

3: rec3 is a better recommendation

  * •

4: All approaches provides appropriate recommendation

Ranking approaches: In rec1, the top 5 services were picked based on number of
times each service has been recommended to a user. In rec2, the top 5 services
are picked based on cosine similarity between the name of services to
recommend and the name of services the user has used historically. In rec3 the
top-5 services are picked based on cosine similarity between the description
of services to recommend and the description of services the account has used
historically. 60% of the times all three annotators agreed that rec1 was able
to provide a better service recommendation to users and 22% of the time they
agreed that all recommendations are equally good.


# Solvable toy model of negative energetic elasticity

Atsushi Iwaki<EMAIL_ADDRESS>Department of Physics,
University of Tokyo, 7-3-1 Hongo, Bunkyo-ku, Tokyo 113-0033, Japan  Soshun
Ozaki  Department of Basic Science, University of Tokyo, 3-8-1 Komaba, Meguro-
ku, Tokyo 153-0041, Japan

###### Abstract

Recent experiments have established negative energetic elasticity, the
negative contribution of energy to the elastic modulus, as a universal
property of polymer gels. To reveal the microscopic origin of this phenomenon,
Shirai and Sakumichi investigated a polymer model on a cubic lattice with the
energy effect from the solvent in finite-size calculations [Phys. Rev. Lett.
130, 148101 (2023)]. Motivated by this work, we provide a simple platform to
study the elasticity of polymer chains by considering a one-dimensional random
walk with the energy effect. This model can be mapped onto the classical Ising
chain, leading to an exact form of the free energy in the thermodynamic or
continuous limit. Our analytical results are qualitatively consistent with
Shirai and Sakumichi’s work. Our model serves as a fundamental benchmark for
studying negative energetic elasticity.

_Introduction.—_ In condensed matter physics, solvable toy models play a
crucial role in understanding the essence of phenomena. For instance, entropic
elasticity, which explains the elastic modulus of rubbers, appears in a one-
dimensional (1D) random walk. This serves as a concrete example to comprehend
how the number of possible states is converted into elasticity through
statistical mechanics [1, 2].

Rubberlike materials consist of polymer chains that form entangled and
crosslinked networks. The elastic modulus of rubberlike materials is
determined not only by the entropic contribution but also by the energetic
one. Experiments with natural and synthetic rubbers have demonstrated that the
energetic contribution is negligibly small [3, 4, 5]. Consequently, the energy
effect has been ignored in the well-known theories of rubber elasticity [6, 7,
8, 9]. However, recent experiments have revealed a significant negative
energetic contribution in polymer gels, which are composed of polymer networks
containing a large amount of solvent [10, 11, 12, 13, 14, 15]. Understanding
the microscopic origins of negative energetic elasticity remains an important
problem.

To address this issue, several approaches have been proposed. Shirai and
Sakumichi investigated a 3D self-avoiding walk, a random walk that does not
overlap with itself, by conducting an exact enumeration [16]. The self-
avoiding walk is acknowledged as an effective lattice model for a single
polymer chain in a dilute solution since it reproduces the excluded volume
phenomena of polymers [17]. The energy effect from solvents was initially
discussed in Ref. [18] and later improved to the so-called interacting self-
avoiding walk [19]. Shirai and Sakumichi treated the self-repulsive
interactions of this model and derived negative energetic elasticity. In
another research, Bleha and Cifra employed the Monte Carlo method to study a
continuum wormlike chain [20], which represents the polymer chain as a
continuous curve and gives energy as the integral of curvature [21]. This
model describes semiflexible polymers characterized by high energy costs for
bending such as a double-stranded DNA [22]. They found a negative energetic
contribution to force at moderate extension, which decreases with higher
extension. Additionally, Hagita et al. conducted all-atom molecular dynamics
simulations on polyethylene glycol hydrogels [23], which was used in the first
observation of negative energetic elasticity [10]. They performed these
simulations under both constant-volume and constant-pressure conditions and
confirmed that the former shows stronger negativity in energetic elasticity.
As a more recent work, Duarte and Rizzi proposed a simple model, a 1D random
walk with independent energy at each step [24]. This model is trivially
solvable because it is non-interacting.

Figure 1:  Schematic illustrations for (a) a single realization of a 1D random
walk with energy cost $\epsilon$ at each bending and (b) the corresponding
configuration of the 1D classical Ising model.

There is a need for an interacting model that can be analytically solved in
the thermodynamic limit because previous approaches rely on finite-size
computations, numerical simulations, or a non-interacting model. In this
Letter, we propose a toy model to study negative energetic elasticity by
introducing an energy cost to each bend in a 1D random walk as shown in Fig.
1(a). This model can be mapped onto the 1D classical Ising model depicted in
Fig. 1(b), resulting in an exact solution in the thermodynamic or continuous
limit. The energy cost at each bending behaves as a self-repulsive interaction
like Shirai and Sakumichi’s work on a self-avoiding walk [16], and as a
result, this model exhibits negative energetic elasticity. Our results are a
natural extension of entropic elasticity in a 1D random walk, thus we believe
that this model will be fundamental to explain the elasticity of polymer gels.

_Model.—_ We start with a 1D random walk characterized by the number of steps
$n$, the width per step $a$, and the final position $x$ as shown in Fig. 1(a).
To incorporate the energy effect, we introduce an energy term $\epsilon$ for
each bending. For instance, the realization depicted in Fig. 1(a) incurs an
energy cost of $4\epsilon$. By associating right (left) steps with up (down)
spins, this model can be mapped onto the 1D classical Ising model as shown in
Fig. 1(b). Therefore, the Hamiltonian of this model is given by

$\displaystyle H_{0}(\bm{\sigma})$
$\displaystyle=\sum_{i=1}^{n-1}\epsilon\frac{1-\sigma_{i}\sigma_{i+1}}{2}$
$\displaystyle=-\frac{\epsilon}{2}\sum_{i=1}^{n-1}\sigma_{i}\sigma_{i+1}+\epsilon\frac{n-1}{2},$
(1)

where $\sigma_{i}=\pm 1$ is the classical spin at site $i$, representing the
right/left direction of $i$-th step. With an external force $F_{\mathrm{ex}}$,
the whole Hamiltonian becomes

$\displaystyle H(\bm{\sigma};F_{\mathrm{ex}})$
$\displaystyle=H_{0}(\bm{\sigma})-F_{\mathrm{ex}}a\sum_{i=1}^{n}\sigma_{i}$
$\displaystyle=-\frac{\epsilon}{2}\sum_{i=1}^{n-1}\sigma_{i}\sigma_{i+1}-F_{\mathrm{ex}}a\sum_{i=1}^{n}\sigma_{i}+\epsilon\frac{n-1}{2},$
(2)

because the final position $x$ is expressed by the spins as
$x=a\sum_{i=1}^{n}\sigma_{i}$. These Hamiltonians express the 1D classical
Ising model with and without a magnetic field up to an energy constant. Our
model is a 1D version of a discrete wormlike chain [25] which is equivalent to
the classical XY model.

In the following, we exactly calculate the thermodynamic functions under two
independent conditions; the external force $F_{\mathrm{ex}}$ is fixed in the
first and the final position $x$ is fixed in the second. The first case is
described by the Ising model in a magnetic field, whereas the second case is
described by the Ising model with a fixed magnetization. The force-fixed and
position-fixed conditions correspond to the constant-pressure and constant-
volume condition of all-atom molecular dynamics in Ref. [23], respectively.
Under both conditions, we can obtain the relationship between $x$ and
$F_{\mathrm{ex}}$ by differentiating the thermodynamic functions. This
relationship allows us to calculate the stiffness $k=\partial
F_{\mathrm{ex}}/\partial x$, which represents the elastic modulus of a single
chain, along with its energetic and entropic contributions.

_Force-fixed condition.—_ We need to consider all possible realizations of a
random walk with an external force $F_{\mathrm{ex}}$, which means all
configurations of the Hamiltonian described by Eq. (2). Consequently, the
partition function at a temperature $k_{B}T=1/\beta$ is given by

$Z_{g}(\beta,F_{\mathrm{ex}},n)=\sum_{\bm{\sigma}}e^{-\beta
H(\bm{\sigma};F_{\mathrm{ex}})}.$ (3)

This partition function can be represented by the transfer matrix as

$Z_{g}(\beta,F_{\mathrm{ex}},n)=\bm{v}^{\top}X^{n-1}\bm{v},$ (4)

where

$X=\begin{bmatrix}e^{\beta F_{\mathrm{ex}}a}&e^{-\beta\epsilon}\\\
e^{-\beta\epsilon}&e^{-\beta
F_{\mathrm{ex}}a}\end{bmatrix},\quad\bm{v}=\begin{bmatrix}e^{\beta
F_{\mathrm{ex}}a/2}\\\ e^{-\beta F_{\mathrm{ex}}a/2}\end{bmatrix}.$ (5)

From the largest eigenvalue of $X$, the Gibbs free energy, the thermodynamic
function under this condition, can be calculated as

$\displaystyle\beta
g_{\mathrm{th}}(\beta,F_{\mathrm{ex}})=-\lim_{n\to\infty}\frac{1}{n}\log
Z_{g}(\beta,F_{\mathrm{ex}},n)$ $\displaystyle=-\log\left[\cosh(\beta
F_{\mathrm{ex}}a)+\sqrt{\sinh^{2}(\beta
F_{\mathrm{ex}}a)+e^{-2\beta\epsilon}}\right].$ (6)

The relationships between $F_{\mathrm{ex}}$ and $x$ is determined through
$x/n=-\partial g_{\mathrm{th}}/\partial F_{\mathrm{ex}}$ as

$\sinh(\beta F_{\mathrm{ex}}a)=e^{-\beta\epsilon}\frac{y}{\sqrt{1-y^{2}}},$
(7)

where $y=x/na$ is the rescaled dimensionless position $x$. The stiffness
$k=\partial F_{\mathrm{ex}}/\partial x$ can be calculated as a function of
$\beta$ and $y$.

$\hat{\beta}\hat{k}(\hat{\beta},y)=\frac{e^{-\hat{\beta}}}{1-y^{2}}\sqrt{\frac{1}{1+(e^{-2\hat{\beta}}-1)y^{2}}}$
(8)

Here, we have introduced rescaled dimensionless quantities
$\hat{k}=na^{2}k/\epsilon$ and $\hat{\beta}=\beta\epsilon$.

In order to decompose the stiffness into its energetic and entropic
contributions as $k=k_{U}+k_{S}$ [10], we consider the Helmholtz free energy
$f_{\mathrm{th}}(\beta,x)$, which is the thermodynamic function under the
position-fixed condition calculated in the next part. Since we can obtain
$F_{\mathrm{ex}}$ by the differentiation of $f_{\mathrm{th}}$ as
$F_{\mathrm{ex}}/n=\partial f_{\mathrm{th}}/\partial x$, the stiffness is
given by $k/n=\partial^{2}f_{\mathrm{th}}/\partial x^{2}$. Considering that
$f_{\mathrm{th}}$ is decomposed into the energetic and entropic term as
$f_{\mathrm{th}}=u-Ts$, the energetic and entropic contributions to the
stiffness can be defined as $k_{U}/n=\partial^{2}u/\partial x^{2}$ and
$k_{S}/n=-T~{}\partial^{2}s/\partial x^{2}$, respectively. By applying
Maxwell’s relation, both contributions can be computed from $k(T,x)$ as
$k_{S}=T~{}\partial k/\partial T$ and $k_{U}=k-k_{S}$.

In the simplest case with $y=0$, the stiffness and its energetic and entropic
contributions are derived from Eq. (8) as

$\hat{\beta}\hat{k}=e^{-\hat{\beta}},\quad\hat{\beta}\hat{k}_{U}=-\hat{\beta}e^{-\hat{\beta}},\quad\hat{\beta}\hat{k}_{S}=(1+\hat{\beta})e^{-\hat{\beta}},$
(9)

where $\hat{k}_{U}=na^{2}k_{U}/\epsilon$ and
$\hat{k}_{S}=na^{2}k_{S}/\epsilon$ are rescaled dimensionless quantities.
Therefore, when the interactions are repulsive ($\epsilon>0$), the energetic
contribution becomes negative ($k_{U}<0$), indicating negative energetic
elasticity. As will be plotted later, the behavior of Eq. (9) is qualitatively
consistent with Fig. 3 of Ref. [16] on a self-avoiding walk.

In the vicinity of a temperature $T_{0}$, the stiffness is approximated by

$k(T)\simeq\frac{k_{S}(T_{0})}{T_{0}}T+k_{U}(T_{0}).$ (10)

Therefore, in experiments and numerical simulations, when the stiffness is
lineally approximated as $k(T)\simeq a(T-T_{U})$, a dimensionless quantity

$\hat{T}_{U}=\frac{k_{B}T_{U}}{\epsilon}=-\frac{k_{U}(T_{0})}{k_{S}(T_{0})}\frac{k_{B}T_{0}}{\epsilon}$
(11)

is used as an indicator of negative energetic elasticity. We can analytically
obtain $\hat{T}_{U}$ in the limit of $T_{0}\to\infty$ as

$\hat{T}_{U}^{\infty}=\lim_{T_{0}\to\infty}\hat{T}_{U}(T_{0})=1-y^{2},$ (12)

indicating that negative energy elasticity diminishes as the chain is
extended. This result is consistent with the previous work on a wormlike chain
[20].

_Position-fixed condition.—_ The position-fixed condition corresponds to the
Ising model with a fixed magnetization, where the partition function is given
by

$Z_{f}(\beta,x,n)=\sum_{\bm{\sigma}}e^{-\beta
H_{0}(\bm{\sigma})}\delta\left(\frac{x}{a},\sum_{i=1}^{N}\sigma_{i}\right).$
(13)

We categorize the summation based on the number of bends as

$\displaystyle Z_{f}(\beta,x,n)=\sum_{m}W(m,x,n)e^{-\beta\epsilon m},$ (14)

where $W(m,x,n)$ is the number of cases of $m$-bending realizations with the
final position $x$ of a $n$-step random walk. Since $W(m,x,n)$ does not depend
on the sign of $x$, we have $Z_{f}(\beta,x,n)=Z_{f}(\beta,-x,n)$. Denoting the
number of right and left steps as

${n_{\mathrm{R}}}=\frac{n}{2}+\frac{x}{2a},\quad{n_{\mathrm{L}}}=\frac{n}{2}-\frac{x}{2a},$
(15)

and assuming $x\geq 0$, i.e., ${n_{\mathrm{R}}}\geq{n_{\mathrm{L}}}$,
$W(m,x,n)$ is evaluated by division into four cases: the random walks starting
with the right/left step and ending with the right/left step. Therefore, we
obtain the partition function as

$\displaystyle Z_{f}(\beta,x,n)=$ $\displaystyle
2\sum_{m=1}^{n_{\mathrm{L}}}\binom{{n_{\mathrm{R}}}-1}{m-1}\binom{{n_{\mathrm{L}}}-1}{m-1}e^{-(2m-1)\beta\epsilon}$
$\displaystyle+\sum_{m=1}^{n_{\mathrm{L}}}\binom{{n_{\mathrm{R}}}-1}{m}\binom{{n_{\mathrm{L}}}-1}{m-1}e^{-2m\beta\epsilon}$
$\displaystyle+\sum_{m=1}^{{n_{\mathrm{L}}}-1}\binom{{n_{\mathrm{R}}}-1}{m-1}\binom{{n_{\mathrm{L}}}-1}{m}e^{-2m\beta\epsilon}.$
(16)

To evaluate the summation, we insert a Kronecker delta in an integral form,

$\displaystyle\delta_{lm}=\frac{1}{2\pi i}\oint_{C}\frac{dz}{z}z^{l-m},$ (17)

where $C$ is a counterclockwise contour around the origin. By carrying out the
summation, we obtain the partition function in an integral form as

$Z_{f}(\beta,x,n)=\frac{e^{-\beta\epsilon}}{\pi
i}\oint_{C}\frac{dz}{z}(1+e^{-\beta\epsilon}z)^{{n_{\mathrm{R}}}-1}\\\
\times(1+e^{-\beta\epsilon}z^{-1})^{{n_{\mathrm{L}}}-1}\left(1+\frac{z+z^{-1}}{2}\right).$
(18)

This representation also holds when $x<0$ because the change of the variable
$z\to w=1/z$ confirms $Z_{f}(\beta,x,n)=Z_{f}(\beta,-x,n)$. Applying the
saddlepoint approximation, we obtain the Helmholtz free energy, the
thermodynamic function under this condition, as

$\beta f_{\mathrm{th}}(\beta,y)=-\lim_{n\to\infty}\frac{1}{n}\log
Z_{f}(\beta,nay,n)=-\frac{1+y}{2}\log\left[1+(1-e^{-2\beta\epsilon})y+e^{-\beta\epsilon}\sqrt{1-(1-e^{-2\beta\epsilon})y^{2}}\right]\\\
-\frac{1-y}{2}\log\left[1-(1-e^{-2\beta\epsilon})y+e^{-\beta\epsilon}\sqrt{1-(1-e^{-2\beta\epsilon})y^{2}}\right]+\frac{1+y}{2}\log(1+y)+\frac{1-y}{2}\log(1-y).$
(19)

From the differentiation of this function as $F_{\mathrm{ex}}a=\partial
f_{\mathrm{th}}/\partial y$, we can derive the relationship between
$F_{\mathrm{ex}}$ and $y$, which is equivalent to Eq. (7). This is because the
Helmholtz free energy $f_{\mathrm{th}}(\beta,y)$ contains the same information
as the Gibbs free energy $g_{\mathrm{th}}(\beta,F_{\mathrm{ex}})$. These two
thermodynamic functions are connected to each other through the Legendre
transformation,

$\displaystyle
g_{\mathrm{th}}(\beta,F_{\mathrm{ex}})=\min_{y}\left[f_{\mathrm{th}}(\beta,y)-F_{\mathrm{ex}}ay\right],$
(20) $\displaystyle
f_{\mathrm{th}}(\beta,y)=\max_{F_{\mathrm{ex}}}\left[g_{\mathrm{th}}(\beta,F_{\mathrm{ex}})+F_{\mathrm{ex}}ay\right].$
(21)

_Numerical demonstrations.—_ Here, we examine our analytical results and
compare them to finite-size numerical simulations with $n=20$ under the force-
fixed and position-fixed conditions.

Figure 2:  (a) Gibbs free energy $\beta g_{\mathrm{th}}$ under the force-fixed
condition in Eq. (6) and (b) Helmholtz free energy $\beta f_{\mathrm{th}}$
under the position-fixed condition in Eq. (19). (c) Energy $\beta u$ and (d)
entropy $s/k_{B}$ as functions of $y=x/na$ obtained from the Helmholtz free
energy $\beta f_{\mathrm{th}}$. These quantities are computed for
$\beta\epsilon=0,\pm 0.6,\pm 1.2$. Data points represent numerical results
with $n=20$. Square points in the panels (b)(d) express modified results to
remove the dominant term of the finite-size effect in Eq. (22).

Figures 2(a) and (b) show the thermodynamic functions under both conditions in
Eqs. (6) and (19). Under the force-fixed condition, the equilibrium value of
$F_{\mathrm{ex}}$ is determined by maximizing
$g_{\mathrm{th}}+F_{\mathrm{ex}}ay$ following Eq. (21). Thus, the Gibbs free
energy $\beta g_{\mathrm{th}}$ is convex upward as seen in Fig. 2(a). On the
other hand, the equilibrium value of $y$ is obtained by minimizing
$f_{\mathrm{th}}-F_{\mathrm{ex}}ay$ following Eq. (20) under the position-
fixed condition, resulting in a convex downward behavior of the Helmholtz free
energy $\beta f_{\mathrm{th}}$ as illustrated in Fig. 2(b). The data points in
Fig. 2(a) are consistent with the analytical results. However, in Fig 2(b),
the raw numerical data represented by circle points differs from the exact
solutions due to the finite-size effect. Detailed calculation of the saddle
point approximation in Eq. (19) allows us to evaluate the dominant term of
this finite-size effect as

$-\frac{1}{n}\log Z_{f}(\beta,nay,n)\simeq\beta
f_{\mathrm{th}}(\beta,y)+\frac{1}{2n}\log n.$ (22)

This dominant term $\log n/2n$, which is independent of $\beta$ and $y$, does
not affect energy, external force, and stiffness. We modify the numerical
results by subtracting the dominant term $\log n/2n$ from the finite-size
calculations of the free energy. The modified numerical results shown as
square dots in Fig. 2(b) are in improved agreement with the exact solutions.

We decompose the Helmholtz free energy $\beta f_{\mathrm{th}}$ into the energy
$\beta u$ and entropy $s/k_{B}$ as shown in Figs. 2(c) and (d). Because the
energetic and entropic contributions to the stiffness are determined by the
second derivative of these quantities, the convexity observed in Figs. 2(c)
and (d) characterizes each contribution to elasticity. When the interaction is
repulsive as $\epsilon>0$, $\beta u$ displays upward convexity, indicating
negative energetic elasticity. In the self-attractive case with $\epsilon<0$,
the entropy becomes convex downward near $y=0$ at low temperature, which means
negative entropic elasticity. After removing the finite-size effect according
to Eq. (22), the numerical results are in good agreement with the exact
solutions.

Figure 3:  Relationship between the external force $\beta F_{\mathrm{ex}}a$
and the final position $y=x/na$ in Eq. (7) for various $\beta\epsilon$. Cross
($\times$) and circle ($\circ$) points represent numerical results with $n=20$
under the force-fixed and position-fixed conditions, respectively.

The relationship between the external force $\beta F_{\mathrm{ex}}a$ and final
position $y$ in Eq. (7) is plotted in Fig. 3. The numerical data are generated
by differentiating the thermodynamic functions shown in Figs. 2(a) and (b).
For the position-fixed condition, $\beta F_{\mathrm{ex}}a$ is approximated
using a finite difference form as

$\beta F_{\mathrm{ex}}a\left(y+\frac{\Delta y}{2}\right)\simeq\frac{\beta
f_{\mathrm{th}}(y+\Delta y)-\beta f_{\mathrm{th}}(y)}{\Delta y},$ (23)

where $\Delta y=2/na$. As expected, the stronger force is required to extend
the chain for the larger $\beta\epsilon$. The numerical results under the
force-fixed condition show good agreement with the exact solutions across the
whole range, while discrepancies arise at high extensions under the position-
fixed condition. This is because the finite-size effect depends on the
ensemble used; it is exponentially small in the force-fixed condition and
polynomially small in the position-fixed condition.

Figure 4:  Stiffness $\hat{\beta}\hat{k}$ and its energetic and entropic
contributions, $\hat{\beta}\hat{k}_{U}$ and $\hat{\beta}\hat{k}_{S}$, with the
final position $y=0$ in Eq. (9). Cross ($\times$) and circle ($\circ$) points
represent numerical results with $n=20$ under the force-fixed condition at
$F_{\mathrm{ex}}=0$ and the position-fixed condition at $y=0$, respectively.
The tangent line of $\hat{\beta}\hat{k}$ at $\hat{\beta}=0$ depicted by a
dashed line intersects the horizontal axis at $1/\hat{T}_{U}^{\infty}$.

Figure 4 displays the stiffness and its energetic and entropic contributions
at $y=0$ in Eq. (9). The numerical data are derived from the second derivative
of the thermodynamic functions shown in Figs. 2(a) and (b) at
$F_{\mathrm{ex}}=0$ or $y=0$, employing a finite-difference form for the
position-fixed case as

$\hat{\beta}\hat{k}(y)\simeq\frac{\beta f_{\mathrm{th}}(y+\Delta y)-2\beta
f_{\mathrm{th}}(y)+\beta f_{\mathrm{th}}(y-\Delta y)}{(\Delta y)^{2}}.$ (24)

We observe negative energetic elasticity in the self-repulsive region with
$\epsilon>0$ and negative entropic elasticity in the self-attractive and low-
temperature region, which aligns with the convexity seen in Figs. 2(c) and
(d). The dashed line represents the tangent line of $\hat{\beta}\hat{k}$ at
$\hat{\beta}=0$. This line crosses the horizontal axis at
$1/\hat{T}_{U}^{\infty}$, which is determined analytically in Eq. (12); in
this case with $y=0$, $\hat{T}_{U}^{\infty}=1$. The numerical results are
almost coincident with the exact solutions for both conditions. The
qualitative behavior of Fig. 4 is consistent with those reported in Fig. 3 of
Ref. [16] on a self-avoiding walk.

_Summary and discussions.—_ We have proposed a toy model to explore negative
energetic elasticity, a 1D random walk with an energy cost $\epsilon$ for each
bending. This model can be mapped onto the 1D classical Ising model by
associating right (left) steps with up (down) spins. Table 1 shows how these
models correspond. We have exactly calculated the thermodynamic functions
under the force-fixed and position-fixed conditions in Eqs. (6) and (19) using
the transfer-matrix formulation and saddlepoint approximation. The Legendre
transformation connects these thermodynamic functions as they are equivalent.
We analytically obtained the stiffness in Eq. (8), which has a negative
energetic contribution when the interaction is repulsive as $\epsilon>0$.

Table 1:  Correspondence between the 1D random walk with interactions and the 1D classical Ising model.  Random walk | Ising model
---|---
right/left step | up/down spin
external force $F_{\mathrm{ex}}$ | magnetic field $h$
final position $x$ | magnetization $M$
stiffness $\displaystyle k=\frac{\partial F_{\mathrm{ex}}}{\partial x}$ |  $(\mathrm{susceptibility})^{-1}$ $\displaystyle\chi^{-1}=\left(\frac{\partial M}{\partial h}\right)^{-1}$

Our model reproduces several properties of previous studies on negative
energetic elasticity. The stiffness and its energetic and entropic
contributions in the simplest case in Eq. (9) plotted in Fig. 4 are
qualitatively consistent with the results of a 3D self-avoiding walk in Fig. 3
of Ref. [16]. Equation (12) shows that the negative energetic contribution
decreases compared to the entropic one with chain extension, in accordance
with Ref. [20] for a continuum wormlike chain. The force-fixed and position-
fixed conditions of our model correspond to the constant-pressure and
constant-volume conditions of all-atom molecular dynamics simulations in Ref.
[23]. Therefore, the finite-size effect in these simulations may resemble our
model. In this sense, our model serves as an essential platform for
investigating the elasticity of polymer chains.

We can extend our model to $d$-dimensional space with $d>1$. In this space,
steps in each direction are mapped onto one of $2d$ possible states arranged
in a line and the energy cost for bending becomes interactions between
different states adjacent to each other. This framework leads to the
$2d$-state Potts model in 1D, which can be also analytically solved under the
fixed-force condition using the transfer matrix method.

_Acknowledgments.—_ We thank Yuta Sakai for comments on the Ising model. We
are also grateful to Naoyuki Sakumichi and Hidehiro Saito for fruitful
discussions. A. I. and S. O. were supported by a Grant-in-Aid for JSPS
Research Fellow (Grant No. 21J21992, 22KJ0988).

## References

  * Kittel [1969] C. Kittel,  _Thermal Physics_ (Wiley, New York, 1969).
  * Kubo [1988] R. Kubo,  _Statistical Mechanics: An Advanced Course with Problems and Solutions_ (North-Holland Physics, New York, 1988).
  * Meyer and Ferri [1935] K. H. Meyer and C. Ferri, Sur l’Ã©lasticitÃ© du caoutchouc, Helvetica Chimica Acta 18, 570â589 (1935).
  * Anthony  _et al._ [1942] R. L. Anthony, R. H. Caston, and E. Guth, Equations of state for natural and synthetic rubber-like materials. I. unaccelerated natural soft rubber, The Journal of Physical Chemistry 46, 826â840 (1942).
  * Mark [1976] J. E. Mark, Thermoelastic results on rubberlike networks and their bearing on the foundations of elasticity theory, Journal of Polymer Science: Macromolecular Reviews 11, 135â159 (1976).
  * Flory [1953] P. J. Flory,  _Principles of Polymer Chemistry_ (Cornell University Press, Ithaca, 1953).
  * James and Guth [1953] H. M. James and E. Guth, Statistical thermodynamics of rubber elasticity, The Journal of Chemical Physics 21, 1039â1049 (1953).
  * Flory [1969] P. J. Flory,  _Statistical Mechanics of Chain Molecules_ (Wiley Interscience, New York, 1969).
  * Flory [1977] P. J. Flory, Theory of elasticity of polymer networks. the effect of local constraints on junctions, The Journal of Chemical Physics 66, 5720â5729 (1977).
  * Yoshikawa  _et al._ [2021] Y. Yoshikawa, N. Sakumichi, U.-i. Chung, and T. Sakai, Negative energy elasticity in a rubberlike gel, Phys. Rev. X 11, 011045 (2021).
  * Sakumichi  _et al._ [2021] N. Sakumichi, Y. Yoshikawa, and T. Sakai, Linear elasticity of polymer gels in terms of negative energy elasticity, Polymer Journal 53, 1293â1303 (2021).
  * Fujiyabu  _et al._ [2021] T. Fujiyabu, T. Sakai, R. Kudo, Y. Yoshikawa, T. Katashima, U.-i. Chung, and N. Sakumichi, Temperature dependence of polymer network diffusion, Phys. Rev. Lett. 127, 237801 (2021).
  * Aoyama and Urayama [2023] T. Aoyama and K. Urayama, Negative and positive energetic elasticity of polydimethylsiloxane gels, ACS Macro Letters 12, 356â361 (2023).
  * Tang  _et al._ [2023a] J. Tang, R. H. Colby, and Q. Chen, Revisiting the elasticity of tetra-poly(ethylene glycol) hydrogels, Macromolecules 56, 2939â2946 (2023a).
  * Tang  _et al._ [2023b] J. Tang, X. Duan, and Q. Chen, Temperature dependence of the gel modulus depends on change of solvent quality, Macromolecules 56, 8574â8580 (2023b).
  * Shirai and Sakumichi [2023] N. C. Shirai and N. Sakumichi, Solvent-induced negative energetic elasticity in a lattice polymer chain, Phys. Rev. Lett. 130, 148101 (2023).
  * Madras and Slade [1996] N. Madras and G. Slade,  _The Self-Avoiding Walk_ (Birkhäuser Boston, 1996).
  * Orr [1947] W. J. C. Orr, Statistical treatment of polymer solutions at infinite dilution, Transactions of the Faraday Society 43, 12 (1947).
  * Vanderzande [1998] C. Vanderzande,  _Lattice Models of Polymers_ (Cambridge University Press, 1998).
  * Bleha and Cifra [2022] T. Bleha and P. Cifra, Energy/entropy partition of force at DNA stretching, Biopolymers 113 (2022).
  * Kratky and Porod [1949] O. Kratky and G. Porod, Röntgenuntersuchung gelöster fadenmoleküle, Recueil des Travaux Chimiques des Pays-Bas 68, 1106â1122 (1949).
  * Broedersz and MacKintosh [2014] C. P. Broedersz and F. C. MacKintosh, Modeling semiflexible polymer networks, Rev. Mod. Phys. 86, 995 (2014).
  * Hagita  _et al._ [2023] K. Hagita, S. Nagahara, T. Murashima, T. Sakai, and N. Sakumichi, All-atom molecular dynamics simulations of poly(ethylene glycol) networks in water for evaluating negative energetic elasticity, Macromolecules 56, 8095â8105 (2023).
  * Duarte and Rizzi [2023] L. K. R. Duarte and L. G. Rizzi, On the origin of the negative energy-related contribution to the elastic modulus of rubber-like gels, The European Physical Journal E 46 (2023).
  * Rosa  _et al._ [2003] A. Rosa, T. X. Hoang, D. Marenduzzo, and A. Maritan, Elasticity of semiflexible polymers with and without self-interactions, Macromolecules 36, 10095â10102 (2003).