# The conformational phase diagram of charged polymers in the presence of
attractive bridging crowders

Kamal Tripathi<EMAIL_ADDRESS>The Institute of Mathematical Sciences,
C.I.T. Campus, Taramani, Chennai 600113, India  Homi Bhabha National
Institute, Training School Complex, Anushakti Nagar, Mumbai 400094, India
Univ. Grenoble Alpes, CNRS, Grenoble INP, 3SR, F-38000 Grenoble, France
Hitesh Garg<EMAIL_ADDRESS>The Institute of Mathematical Sciences,
C.I.T. Campus, Taramani, Chennai 600113, India  Homi Bhabha National
Institute, Training School Complex, Anushakti Nagar, Mumbai 400094, India  R.
Rajesh<EMAIL_ADDRESS>The Institute of Mathematical Sciences, C.I.T.
Campus, Taramani, Chennai 600113, India  Homi Bhabha National Institute,
Training School Complex, Anushakti Nagar, Mumbai 400094, India  Satyavani
Vemparala<EMAIL_ADDRESS>The Institute of Mathematical Sciences, C.I.T.
Campus, Taramani, Chennai 600113, India  Homi Bhabha National Institute,
Training School Complex, Anushakti Nagar, Mumbai 400094, India

###### Abstract

Using extensive molecular dynamics simulations, we obtain the conformational
phase diagram of a charged polymer in the presence of oppositely charged
counterions and neutral attractive crowders for monovalent, divalent and
trivalent counterion valencies. We demonstrate that the charged polymer can
exist in three phases: (1) an extended phase for low charge densities and weak
polymer-crowder attractive interactions ($CE$), (2) a collapsed phase for high
charge densities and weak polymer-crowder attractive interactions, primarily
driven by counterion condensation ($CCI$), and (3) a collapsed phase for
strong polymer-crowder attractive interactions, irrespective of the charge
density, driven by crowders acting as bridges or crosslinks ($CCB$).
Importantly, the simulations reveal that the interaction with crowders can
induce collapse, despite the presence of strong repulsive electrostatic
interactions, and can replace condensed counterions to facilitate a direct
transition from the $CCI$ and $CE$ phases to the $CCB$ phase.

polyelectrolyte, crowders, bridging, phase diagram

##  I Introduction

Charged polymers or polyelectrolytes (PEs), are ubiquitous in nature,
encompassing biological examples like DNA and proteins, as well as synthetic
counterparts such as block copolymers and sodium polystyrene sulfonate etc.
[1, 2, 3, 4, 5, 6, 7, 8, 9]. The conformations of highly charged PEs are
influenced by a combination of factors, including long-range electrostatic
interactions, counterion entropy, solvent quality, temperature, counterion
valency, and dielectric constant of the solvent, which are reasonably well-
understood [10, 11, 12, 13, 14]. With increase in PE backbone charge density,
the oppositely charged counterions begin to condense onto the PE via Manning
condensation [15, 16]. Beyond a critical charge density, the PE undergoes a
transition from an extended to a collapsed conformation, irrespective of
solvent quality [17, 18, 19, 20, 21, 22, 23, 18, 24, 25, 26, 27, 28, 29].
Several mechanisms, such as ionic solid theory, dipole theory, and counterion
fluctuation theory, have been proposed to explain various aspects of the
counterintuitive collapse behavior of like-charged PEs [18, 19, 20, 30, 31,
32, 33, 34, 18, 27, 17, 35, 21, 22, 23, 18, 36, 25, 28, 15, 37, 35, 38].

While the conformations of an isolated PE have been studied in detail, it is
important to consider that PEs often exist within complex and crowded
heterogeneous environments [39, 40, 41, 42, 43, 44, 45]. In such environments,
the conformational landscape of even neutral polymers is significantly altered
by the presence of crowder molecules, which can induce novel phases such as
bridging and depletion-induced collapsed phases (see details below) through
specific or non-specific interactions [46, 47, 48, 49, 50, 51, 52, 53, 54]. It
is, thus, reasonable to expect that crowders will also affect the
conformations of a PE, as the relative strength of the polymer-crowder
interactions and electrostatic interactions is varied. Although few prior
studies [55, 56] have shown that the inclusion of crowders molecules stabilize
the crowder-free equilibrium collapsed conformations of small charged or
overall charge-neutral polymers, the specific mechanisms underlying crowder-
polymer interactions and the intricate interplay between counterions and
crowders remain unexplored. Thus, despite the widespread applications, a
comprehensive understanding of how both crowders and counterions influence PE
conformations is currently lacking and constitutes the central focus of this
paper.

Unlike the case of PEs, the effect of crowders on the conformations of neutral
polymers is better studied. When the polymer-crowder interactions are purely
repulsive, entropic effects can induce effective depletion induced attractive
interactions between the monomers which in turn drive a collapse transition
[40, 53, 54, 57, 58, 59, 60, 61]. The depletion effects are enhanced with
further attractive interaction among the crowders [62]. When the interactions
between the polymer and the crowders exhibit weak attraction, the crowders
assume the role of a typical good solvent, leading to a preference for
extended polymer conformations. However, on further increase of polymer-
crowder attractive interactions, a counterintuitive collapse transition
(effective poor solvent condition) is observed even for a self-avoiding
polymer where the crowders act as bridges or crosslinks between monomers. [63,
64, 65, 66, 62]. Recently, we obtained the detailed configurational phase
diagram of neutral polymers in the presence of attractive crowders, by
delineating phase transitions from extended conformations to collapsed
conformations induced by both intra-polymer attraction and bridging effects
due to crowders [62].

The effect of crowders on the conformation of PEs is also of considerable
interest in the context of membrane less biomolecular condensates [67, 68, 69,
70]. These condensates form due to either polymer polymer phase separation
(PPPS) or liquid liquid phase separation (LLPS), both driven by strong
attractive interaction with crowders. Studied primarily from the perspective
of chromatin organization, these two mechanisms of phase separation mainly
differ in the relative strengths of chromatin-chromatin interactions and
chromatin-crowder interactions. PPPS is driven by formation of bridges or
cross links between distant parts along chromatin mediated by crowder
molecules, thus generating a collapsed globule conformation. The bridging
crowders do not undergo a phase separation in the absence of attractive
interaction with chromatin. LLPS, on the other hand, leads to condensates
resembling liquid-like crowder-chromatin droplets. Unlike PPPS, the crowders
phase separate even in the absence of chromatin. There are experimental and
theoretical studies investigating the role of bridging interactions in
chromatin reorganization via PPPS or LLPS [71, 72, 73, 74, 75, 76, 77, 78,
79]. However, despite chromatin being inherently a charged polymer, it is
usually modeled as a coarse-grained neutral polymer in the presence of neutral
crowders, thus ignoring the presence of charged counterions and long range
interactions [71, 72, 73, 74, 77]. A study of PE in a crowded environment,
provides a more realistic model for biopolymers such as chromatin and also
makes it possible to investigate phenomena such as PPPS arising due to
competing interactions with counterions and crowders.

In this paper, we investigate the impact of attractive neutral crowders on the
conformations of a single, similarly charged PE in the presence of oppositely
charged counterions. We employ extensive molecular dynamics simulations
utilizing generic coarse-grained bead-spring models. We identify three
distinct phases: (1) the $CCI$ phase, which corresponds to a collapsed state
primarily driven by the condensation of counterions; (2) the $CE$ phase,
characterized by an extended conformation of the polymer due to repulsive
electrostatic interactions within the PE; and (3) the $CCB$ phase,
representing a secondary collapsed state primarily induced by the presence of
attractive bridging crowders, with a substantial number of crowders located
within the collapsed conformation. By identifying the phase transitions among
these phases, we obtain the phase diagram in the PE charge density and
polymer-crowder interaction phase space for monovalent, divalent, and
trivalent counterions.

##  II Model and methods

We model a flexible PE chain using a coarse-grained linear bead-spring model
consisting of $N_{m}$ monomers of charge $-q$ (measured in units of $e$)
linked together by harmonic springs with bond interaction energy

$U_{bond}(r)=\frac{1}{2}k(r-r_{0})^{2},$ (1)

where $k$ is the spring constant, $r_{0}$ is the equilibrium bond-length and
$r$ is the distance between two bonded monomers. We set $r_{0}=2^{1/6}\sigma$,
$k=500k_{B}T\sigma^{-2}$, where $\sigma$ is the size of the monomer in Lennard
Jones (LJ) units (see below), $k_{B}$ is the Boltzmann’s constant and $T$ is
the temperature. $N_{m}/Z$ neutralizing counterions with charge $+Zq$, each of
the same size and mass as the monomer, are added to the system, where $Z$ is
the valency of the counterion ($Z=1,2,3$). In addition, $N_{c}$ neutral
crowders, of same size and mass as the monomer, are added such that the number
density of the crowders is $\rho_{c}=N_{c}/L^{3}=0.05\sigma^{-3}$, where $L$
is the size of the simulation box. The monomer density is fixed at
$N_{m}/L^{3}=1.112\times 10^{-3}\sigma^{-3}$. For this box length, the PE
chain in its extended phase does not interact with its own periodic images.

Non-bonded pairs of particles interact via excluded volume interactions (PE
monomers, counterions, crowders) as well as long ranged electrostatic
interactions (PE monomers, counterions). The excluded volume interactions are
modeled by the truncated and shifted LJ potential,

$U_{jk}(r)=4\epsilon_{jk}\left[\left(\dfrac{\sigma}{r}\right)^{12}-\left(\dfrac{\sigma}{r}\right)^{6}\right],~{}r<r^{jk}_{c},$
(2)

where indices $j$ and $k$ can be $m$ (monomer), $i$ (counterion) or $c$
(crowder), and $r$ is the distance between two particles. The parameter
$\epsilon_{jk}$ and cutoff $r^{jk}_{c}$ are pair-dependent while $\sigma$ is
same for all particles. The LJ parameters for the different pairs are listed
in Table 1. Other than $m$–$c$ and $c$–$c$ pairs, all other pair interactions
are purely repulsive. In particular, this choice mimics an implicit good
solvent condition for the polymer.

Table 1:  Parameters for the LJ potential [see Eq. (2)] between different pairs of particles. The notations $m$, $i$ and $c$ represent monomers, counterions and crowders respectively.  pair | $\epsilon$ | $\sigma$ | $r_{c}$
---|---|---|---
$m$ \- $m$ | 1.0 | 1.0 | $2^{1/6}$
$i$ \- $i$ | 1.0 | 1.0 | $2^{1/6}$
$m$ \- $i$ | 1.0 | 1.0 | $2^{1/6}$
$m$ \- $c$ | $\epsilon_{mc}$ | 1.0 | $2.5$
$i$ \- $c$ | 1.0 | 1.0 | $2^{1/6}$
$c$ \- $c$ | 1.0 | 1.0 | $2.5$

The PE, counterions, and crowders are assumed to be in a medium of uniform
relative dielectric constant $\varepsilon$. The electrostatic energy between
any two charges $q_{1}$ and $q_{2}$ separated by distance $r$ is given by

$U_{C}(r)=\frac{q_{1}q_{2}}{4\pi\varepsilon\varepsilon_{0}r},$ (3)

where $\varepsilon_{0}$ is the dielectric permittivity of vacuum. The relative
strength of electrostatic interactions among charged monomers along the PE
chain is characterized by a dimensionless parameter $A$:

$A=\frac{q^{2}\ell_{B}}{r_{0}},\quad\ell_{B}=\frac{e^{2}}{4\pi\varepsilon\varepsilon_{0}k_{B}T},$
(4)

where $\ell_{B}$ is the Bjerrum length [35] at which the electrostatic energy
between two elementary charges $e$ is comparable to the thermal energy
$k_{B}T$. The strength of electrostatic interactions, $A$, can be tuned by
either changing $q$ while keeping $\varepsilon$ fixed or by changing
$\varepsilon$ while keeping $q$ fixed. In our simulations, we systematically
scale the monomer charges $q$ to vary $A$. For $Z=1,2,3$, we do simulations
for $A/A_{c}$ ranging from $0.001$ to $2.0$, where $A_{c}$ is the critical
charge density for a PE in a good solvent in the absence of crowders. For each
value of $A$, a range of values of $\epsilon_{mc}$ are explored. Lengths,
temperatures and times are given in units of $\sigma$, $\epsilon/k_{B}$, and
$\sqrt{m\sigma^{2}/\epsilon}$ respectively.

All the simulations are carried out using the molecular dynamics simulation
package LAMMPS [80] in NVT ensemble with periodic boundary conditions. The
equations of motion are integrated using the velocity-Verlet algorithm [81,
82] with a time step of $0.001$. The system is initially equilibrated for
$10^{6}$ steps and the analyses are done over subsequent $10^{7}$ steps. The
temperature is maintained through a Nosé-Hoover thermostat [83, 84]. The long
ranged Coulomb interactions are evaluated using the particle-
particle/particle-mesh (PPPM) technique [85].

##  III Results

###  III.1 Collapse transition in PEs with crowder interactions

Before investigating the influence of attractive neutral crowders on the
conformational behavior of charged PEs, we first determine the critical charge
density, $A_{c}$, for the extended-collapsed transition of a single PE in good
solvent conditions, in the absence of crowders. To determine $A_{c}$, we
monitor the radius of gyration, $R_{g}$, as a function of $A$, for all the
three counterion valencies. $R_{g}$ is defined as

$R_{g}^{2}=\frac{1}{2N_{m}^{2}}\sum_{j=1}^{N_{m}}\sum_{k=1}^{N_{m}}|{\vec{r}}_{j}-{\vec{r}}_{k}|^{2},$
(5)

where ${\vec{r}}_{i}$ denotes the position vector of the $i$-th monomer. The
variation of $R_{g}$ with $A$ for two different values of $N_{m}$ is shown in
Fig. 1. By identifying the collapsed phase to be the regime where the data for
$R_{g}/N_{m}^{1/3}$ collapse onto one curve, we obtain $A_{c}\approx
9.5,4.0,2.0$ for $Z=1,2,3$ respectively. These values are larger than those
obtained earlier for the PE in poor solvent conditions [17].

Figure 1: The variation of radius of gyration, $R_{g}$, with charge density
$A$ for two lengths of the PE, $N_{m}=48,96$, in the absence of crowders. The
collapsed phase is identified to be the regime when the data for
$R_{g}/N_{m}^{1/3}$ collapse on top of each other. The vertical dashed lines
correspond to $2.0,4.0,9.5$ and are identified as approximate values of
$A_{c}$.

Our aim is to identify the different phases and obtain the phase diagram of
the PE in the presence of attractive crowders, particularly in the
$A$–$\epsilon_{mc}$ phase space. Towards this end, we determine $R_{g}$ and
asphericity, $\alpha$, at different attractive strengths, $\epsilon_{mc}$, for
a range of values of $A/A_{c}$. Asphericity, $\alpha$, is defined as [86, 87,
88]

$\alpha=\frac{\lambda_{1}\lambda_{2}+\lambda_{2}\lambda_{3}+\lambda_{3}\lambda_{1}}{(\lambda_{1}+\lambda_{2}+\lambda_{3})^{2}},$
(6)

where $\lambda_{1},\lambda_{2},\lambda_{3}$ are the eigenvalues of the moment
of inertia tensor and the value of $\alpha$ varies between 0 (sphere) and 1
(rod).

We first focus on $A/A_{c}<1$ (partial counterion condensation regime), where
in the absence of crowders, the PE is in an extended conformation, the $CE$
phase, due to intra polymer electrostatic repulsion. Consider the case of
trivalent counterions, shown in Fig. 2 (a). When the crowder strength
$\epsilon_{mc}$ is relatively small, the value of $R_{g}$ closely resembles
that observed without crowders, thus maintaining the extended conformation of
the PE. However, as $\epsilon_{mc}$ increases further, a rapid reduction in
$R_{g}$ is observed, indicating a pronounced collapse of the PE. Concurrently,
the asphericity of the PE diminishes from a value close to $0.5$ to near zero,
consistent with expectations for a collapsed phase, as depicted in Figure 2
(b). To understand the origin of this attractive crowder induced collapse of
PE, we examine the radial density distribution of crowders, $\rho_{c}(r)$,
measured from the center of mass of the PE in the collapsed phase
($\epsilon_{mc}=4.0$). Fig. 3 shows an excess crowder density within the
collapsed PE region compared to the exterior, indicating that the collapse can
be primarily attributed to bridging interactions with crowders rather than
depletion effects. This specific collapsed phase, triggered by bridging
interactions with neutral crowders, will be referred as the $CCB$ (bridging-
induced collapsed) phase. Further evidence of the PE being collapsed for large
$\epsilon_{mc}$ can be seen from the data collapse of $R_{g}/N_{m}^{1/3}$, for
two different PE chain lengths, in Fig. S1 (see Supp Info). We can thus
identify a critical $\epsilon_{mc}^{*}$, for each $A/A_{c}<1$, beyond which an
extended to collapsed transition ($CE$-$CCB$) is driven by bridging neutral
crowders. This allows us to construct the $CE$-$CCB$ phase line in Sec. III.2.
Similar trends are seen for divalent counterions as well [see Fig. 2(c),(d)].

Figure 2: $A/A_{c}<1.0$: The radius of gyration, $R_{g}$, of the PE chain and
asphericity $\alpha$ as a function of $\epsilon_{mc}$ for (a, b) $Z=3$, (c, d)
$Z=2$, (e, f) $Z=1$, and $N_{m}=48$. Figure 3: $A/A_{c}=0.1$: Radial density
function of crowders $\rho_{c}(r)$ measured from the center of mass of the
collapsed PE chain for all the three valencies of counterions for
$\epsilon_{mc}=4.0$.

The dependence of $R_{g}$ on $\epsilon_{mc}$ for monovalent counterions
exhibits distinct characteristics compared to PEs with divalent and trivalent
counterions, as shown in Fig.2 (e). While the behavior of $R_{g}$ for
monovalent counterions at $A/A_{c}=0.01$ and $0.1$ is similar to that of
divalent and trivalent counterions, the transition occurs at larger critical
values of $\epsilon_{mc}^{*}$. In contrast, for $A/A_{c}=0.5$ and $0.8$, the
increase in $\epsilon_{mc}$ does not lead to a significant reduction in
$R_{g}$. Moreover, the corresponding asphericity remains significantly
different from zero even at large $\epsilon_{mc}$ values, as illustrated in
Fig.2 (f). Taken together, this suggests that the PE does not undergo collapse
for intermediate $A$ values in the presence of monovalent counterions. We
discuss the implications of this feature for the phase diagram for monovalent
counterions in Sec. III.2.

To understand the interplay between the condensed counterions and crowders as
a function of increased monomer-crowder interaction strength, we calculate
their numbers, $n_{i}$ and $n_{c}$ within a distance of $2\sigma$ of any
monomer. In the regime of very low $A$ values, where Manning condensation has
yet to take effect, $n_{i}$ remains close to zero across all $\epsilon_{mc}$
values, while $n_{c}$ exhibits an increase that eventually saturates at larger
$\epsilon_{mc}$ values, for $Z=1,2,3$, as depicted in Fig. 4. While the
behavior of $n_{c}$ is largely unaffected by variations in $A/A_{c}$, a clear
reduction in the number of condensed counterions with increasing
$\epsilon_{mc}$ is observed for values of $A/A_{c}\lesssim 1$. A consequent
increase in repulsive electrostatic energy, due to loss of charge
renormalizing counterions, is however compensated by the increased attractive
van der Waal energy due to neutral crowders, as can be seen from Fig. S2, and
drives the collapse of PE.

Figure 4: The number of condensed counterions, $n_{i}$, and condensed
crowders, $n_{c}$, within a distance $2\sigma$ of the PE chain as a function
of $\epsilon_{mc}$ for $A/A_{c}<1.0$ for (a, b) $Z=3$, (c, d) $Z=2$, (e, f)
$Z=1$.

We now focus on the results for $A/A_{c}>1$, where in the absence of crowders,
complete counterion condensation occurs and the PE is in a collapsed
conformation. Consider first the case for trivalent counterions. When
$\epsilon_{mc}$ is increased from zero, an increase of $R_{g}$ can be seen
from Fig. 5(a) suggesting swelling of the collapsed conformation. For this
range of $\epsilon_{mc}$ values, the crowders effectively act as good solvent
conditions and the swelling can be attributed to enhanced attractive
interaction energy between PE and crowders. For larger values of
$\epsilon_{mc}$, the $R_{g}$ saturates to a value that is independent of value
of $\epsilon_{mc}$. Throughout this entire range of $\epsilon_{mc}$, $R_{g}$
consistently maintains values significantly smaller than those corresponding
to the extended phase of the PE for $A/A_{c}<1$ (as seen in Fig.2(a)),
demonstrating that the PE retains a collapsed conformation. This is further
supported by the consistently low values of the asphericity, $\alpha$, shown
in Fig.5(b). In order to quantitatively validate the collapsed state of the PE
across the entire $\epsilon_{mc}$ range, Fig.6(a) illustrates the data
collapse of $R_{g}$ onto one curve for two distinct system sizes when scaled
by $N_{m}^{1/3}$. Similar trends are observed for both divalent (see
Fig.5(c-d)) and monovalent (see Fig.5(e-f)) counterions.

Figure 5: $A/A_{c}>1.0$: The radius of gyration, $R_{g}$, of the PE chain and
asphericity $\alpha$ as a function of $\epsilon_{mc}$ for (a, b) $Z=3$, (c, d)
$Z=2$, (e, f) $Z=1$, and $N_{m}=48$. Figure 6: (a) The scaled $R_{g}$ for two
different $N_{m}=48,96$ for $A/A_{c}=1.2$ and $Z=3$. (b-c) Snapshots of
typical configurations for $N_{m}=48$ and $Z=3$ with $A/A_{c}=1.2$ for (b)
$\epsilon_{mc}=0.1$ and (c) $\epsilon_{mc}=3.0$. The monomers, counterions and
crowders are colored by blue, lime green, and golden yellow respectively.

With the understanding that the PE consistently maintains a collapsed
conformation across the entire range of $\epsilon_{mc}$ values, we now probe
whether the nature of this collapsed phase remains uniform throughout.
Snapshots of the PE(blue color particles), along with counterions(lime green
particles) and crowders(golden yellow particles) within a distance of
$2\sigma$ from the PE, are shown in Fig.6(b-c) for both small and large
$\epsilon_{mc}$ values. In the case of small $\epsilon_{mc}$, the collapsed
phase lacks crowders within the globule, forming what we refer to as the $CCI$
phase. In contrast, for large $\epsilon_{mc}$, a significant number of
crowders are enclosed within the globule, defining the $CCB$ phase, as
discussed previously. To differentiate between these two collapsed phases
($CCI$ and $CCB$), we analyze the radial density distribution of the crowders
from the center of the collapsed globule, $\rho_{c}(r)$, as shown in Fig.7.
For all counterion valencies, it can be seen that the crowders are depleted
from the center of the collapsed globule under small $\epsilon_{mc}$
conditions ($CCI$ phase), in contrast to the bulk crowder density
($\rho_{c}^{bulk}=0.05$). In contrast, for large $\epsilon_{mc}$ values ($CCB$
phase), a pronounced crowder overpopulation is observed within the globule
($\rho_{c}^{center}\approx 2.5$), strongly indicating that the two collapsed
phases are distinct.

Figure 7: Radial density function of crowders $\rho_{c}(r)$ measured from the
center of mass of the collapsed PE chain for all the three valencies of
counterions considered in the study for $\epsilon_{mc}=0.1,4$. The data shown
in this figure is for system with crowder density $\rho_{c}=0.05$ and
$A/A_{c}=2.0$. The critical Radial density function $\rho_{c}(r)$ of crowders
within collapsed conformation for all the three valencies of counterions
considered in the study as a function of $\epsilon_{mc}$. The transition from
$CCI-CCB$ phase is identified via this parameter. The data shown in this
figure is for system with crowder density $\rho_{c}=0.05$.

To identify the transition between the two collapsed $CCI$ and $CCB$ phases,
we define a mean density of crowders within the collapsed phase,
$\overline{\rho}_{c}$, as the density within a radius $R_{g}/2$. As can be
seen from the right panels of Fig. 7, $\overline{\rho}_{c}$ remains close to
zero for small $\epsilon_{mc}$ values across all counterion valencies, then
sharply increases beyond a critical threshold $\epsilon_{mc}^{*}$. Remarkably,
the $\overline{\rho}_{c}$ data exhibits minimal dependence on $A/A_{c}$,
implying that the critical $\epsilon_{mc}^{*}$ is relatively independent of
$A$ for $A/A_{c}>1$. We now ask whether the introduction of crowders leads to
the displacement of condensed counterions from the $CCI$ phase, as a function
of $\epsilon_{mc}$? For all counterion valencies, even though $A$ is large, as
$\epsilon_{mc}$ is increased counterions are expelled from the PE globule, as
can be seen from the variation of $n_{i}$ with $\epsilon_{mc}$ in Fig. 8.
Correspondingly, the number of condensed crowders, $n_{c}$ increases sharply
to compensate for the increased electrostatic repulsion (see right panels of
Fig. 8). It is worth noting that the number of condensed crowders, $n_{c}$,
exceeds that of the displaced counterions by an order of magnitude. The
consequent increase in electrostatic energy is compensated by the attractive
van der Waal energy as can be seen from Fig. S3.

Figure 8: The number of condensed counterions, $n_{i}$, and condensed
crowders, $n_{c}$, within a distance $2\sigma$ of the PE chain as a function
of $\epsilon_{mc}$ for $A/A_{c}>1.0$ for (a, b) $Z=3$, (c, d) $Z=2$, (e, f)
$Z=1$.

###  III.2 Conformational phase diagram of PEs with crowder interactions

In Sec. III.1, we showed that PE can exist in three phases in the presence of
neutral crowders. (1)$CE$: extended conformations for low charge density,
below a critical value, and weak PE–crowder attractive interactions, (2)$CCB$:
collapsed conformations for charged density values less than or near the
critical value and for strong PE–crowder attractive interactions, and
(3)$CCI$: collapsed conformations for charged density values higher than the
critical value, primarily due to counterion condensation. We now explore the
complete phase diagram of the system in $A$-$\epsilon_{mc}$ plane and
demarcate the phase boundaries.

We choose two different parameters to locate the phase boundaries among the
three phases $CE$-$CCB$ and $CCI$-$CCB$. Similar to our previous work [62],
variation of $R_{g}$ with $\epsilon_{mc}$ curves for various values of
$A/A_{c}$ will be used for $CE$-$CCB$ phase boundary as follows. A curve from
$R_{g}$ vs $\epsilon_{mc}$ plot is chosen which represents a specific
$A/A_{c}$ value. This curve is then fitted to a general hyperbolic tangent
function ($R_{g}(\epsilon_{mc})$). The first derivative
$dR_{g}/d\epsilon_{mc}$ gives the rate of change of $R_{g}$ with respect to
$\epsilon_{mc}$. Solving $dR_{g}/d\epsilon_{mc}$ = 0 yields the value
$\epsilon_{mc}^{*}$ for which the rate of change of $R_{g}$ with respect to
$\epsilon_{mc}$ is maximum. The value of $\epsilon_{mc}^{*}$ indicates the
location of phase boundary between two phases on either side of
$\epsilon_{mc}$. This process is repeated for all the different value of
$A/A_{c}$. However, for obtaining the $CCI$-$CCB$ phase boundary, $R_{g}$ is
not a good parameter as it does not vary much across the two collapsed phases.
On the other hand, the parameter $\overline{\rho}_{c}$ clearly distinguishes
between the two collapsed phases, as can be seen from Fig. 7 and we use it to
identify the $CCI$-$CCB$ phase boundary. Similar to how we analyzed $R_{g}$ to
determine the phase boundary between $CE$-$CCB$, we pinpoint the critical
value of $\epsilon_{mc}^{*}$ for the $CCI$-$CCB$ phase transition by
identifying the point at which the rate of change of $\overline{\rho}_{c}$
with respect to $\epsilon_{mc}$ is maximized. To determine the $CE$-$CCI$
phase boundary, we simulate the PE for $N_{m}=48,96$, and identify the
critical value of $A$ to be that value beyond which the data for
$R_{g}/N_{m}^{1/3}$ collapse onto one curve.

The phase diagram in the $A$-$\epsilon_{mc}$, thus obtained from the two
analysis described above, can be seen in Fig. 10. For all the three counterion
valencies, the three direct phase transitions $CE$-$CCI$, $CE$-$CCB$, and
$CCI$-$CCB$ are possible. However, for monovalent counterions, for the range
of $\epsilon_{mc}$ considered, there is no $CE$-$CCB$ phase transition for
intermediate values of $A$. This implies that, for fixed $\epsilon_{mc}\gtrsim
2$ and increasing $A/A_{c}$, we expect a reentrant $CCB$-$CE$-$CCB$ phase
transition. If this were the case, then if the system is simulated at a fixed
large $\epsilon_{mc}$ and by increasing $A$, the PE should undergo collapsed-
extended-collapsed transitions. The results for such simulations are shown in
Fig. 9. For intermediate values of $A/A_{c}$, the PE is extended, as can be
seen from the snapshot, with a corresponding large value of $R_{g}$ compared
to small and large $A/A_{c}$ [see Fig. 9(a)]. For small and large $A/A_{c}$,
the PE is collapsed as can be seen from both the snapshots [see Fig. 9(a)], as
well as asphericity being close to zero [see Fig. 9(b)]. Thus we confirm that
for intermediate $A/A_{c}$, attractive crowders are unable to drive an
extended to collapsed transition.

Figure 9: $Z=1$: The variation of (a) $R_{g}$ and (b) $\alpha$ with $A/A_{c}$
for fixed $\epsilon_{mc}=4,6$. The snapshots in (a) correspond to
$\epsilon_{mc}=4.0$.

We also observe that the critical value $\epsilon_{mc}^{*}$ for the
$CCI$-$CCB$ phase transition is largely independent of $A$. This is
surprising, as one would expect that for higher values of parameter $A$, the
CCI phase’s stability would strengthen, necessitating a correspondingly larger
$\epsilon_{mc}$ to induce its destabilization. A discussion of the
implications for the different theories of PE can be found in Sec. IV.
Further, the $CE$-$CCI$ phase boundary is largely independent of
$\epsilon_{mc}$ for small $\epsilon_{mc}$ and occurs around $A/A_{c}\approx
1$. This is to expected as the transition is driven by condensed counterions,
and crowders do not play any significant role. For intermediate values of
$\epsilon_{mc}$, the presence of crowders decreases $A_{c}$.

Figure 10: The conformational phase-diagram of the PE in the
$A/A_{c}$-$\epsilon_{mc}$ for (a) $Z=3$, (b) $Z=2$, and (c) $Z=1$. The $CE$,
$CCI$ and $CCB$ phases are represented in red, blue, and green colors
respectively.

##  IV Discussion and Conclusion

The notion of macromolecular crowding in cellular environments affecting the
stability of biopolymers, such as proteins, is now well-known [89, 90].
However, most of the studies on crowders treat the crowders as hard particles,
whose primary mode of interaction with proteins or model polymers is via
depletion: the entropically driven exclusion of repulsive crowders leads to
the collapse of the polymer/protein. Only recently, the role of soft
attractive interactions between polymers and crowders has been explored, and
it has been implicated in various phenomena such as chromosome organization,
LLPS (liquid-liquid phase separation), etc [67, 68, 69, 70, 71, 72, 73, 74,
77]. Simple polymer models have been effectively used to understand the role
of soft attractive interactions between crowders and biopolymers like
chromatin, demonstrating their impact on the conformational landscape. These
studies have investigated the influence of both attractive polymer-crowder
interaction energy and crowder density. However, it should be noted that most
of these models are based on neutral polymers, and their relevance to
inherently charged biopolymers remains unclear.

Like-charged polymers, polyelectrolytes(PE), have been shown to undergo a
counterintuitive extended to collapsed transition, in the presence of
oppositely charged counterions, when the charge density of the backbone, $A$,
is larger than a critical value $A_{c}$ [17, 18, 19, 20, 21, 22, 23, 18, 24,
25, 26, 27, 28, 29]. This dependence of the PE conformations on $A$ suggests
an analogy with monomer-monomer interaction energy ($\epsilon_{mm}$) in
neutral polymers, where small and large $\epsilon_{mm}$ values correspond to
extended and collapsed states, respectively. Recently, we obtained a detailed
phase diagram for neutral polymers in the presence of attractive crowders in
the $\epsilon_{mm}$-$\epsilon_{mc}$ phase, where $\epsilon_{mc}$ represents
the polymer-crowder interaction strength [62]. In this paper, we explored the
conformations of PEs in the $A$-$\epsilon_{mc}$ phase space. We addressed the
following questions: (1) Do neutral crowders differentially affect the
conformations of PE, depending on the charge density of the PE ($A$)? (2) What
is the role of the valency ($Z$) of the counterions? (3) What is the
conformational phase diagram of PE in the $A$-$\epsilon_{mc}$ phase space? (4)
How do attractive crowders impact charged polymers compared to neutral
polymers?

We demonstrate that attractive neutral crowders have the ability to collapse a
charged extended polymers, despite the inherent repulsive interactions arising
from like charges. This collapse phenomenon occurs for all counterion
valencies. We show the existence of three distinct phases in the
$A-\epsilon_{mc}$ phase space: (1) An extended phase denoted as $CE$, observed
for low charge densities and weak polymer-crowder attractive interactions. For
monovalent counterions, the $CE$ also exists for strong polymer-crowder
attractive interactions. (2) A collapsed phase labeled as $CCI$, observed for
high charge densities and weak polymer-crowder attractive interactions,
primarily driven by the condensation of counterions within the polymer
structure. (3) A collapsed phase denoted as $CCB$, observed for strong
polymer-crowder attractive interactions, regardless of the charge density (at
least for $Z=2,3$), facilitated by the crowders acting as bridges or
crosslinks between the monomers.

Interestingly, the critical value of $\epsilon_{mc}$ required to induce the
collapse of charged polymers ($CE$-$CCB$ transition) with divalent and
trivalent counterions is not significantly different from that observed for
neutral polymers, as reported in our previous work [62]. However, we find that
monovalent counterions exhibit distinct effects on the phases compared to
multivalent counterions. In particular, for intermediate values of $A$, we
find that that the PE does not collapse for even quite large values of
$\epsilon_{mc}$. This may be due to steric effects which limits the number of
crowders that can condense onto the PE. If this were true, then smaller sized
crowders should induce a $CE$-$CCB$ transition for intermediate values of $A$,
because a larger number of crowders can be accommodated around the PE.
Studying the effects of crowder size on the phase diagram is a promising area
for future study.

Across the $CE$-$CCB$ transition, the number of crowders increases
substantially compared to the decrease in the number of condensed counterions,
strongly suggesting that a much larger number of neutral crowders is required
to collapse the charged PE to overcome the strong electrostatic repulsion.
This difference in number of non-polymer particles inside the collapsed phase
of the PE can lead to new subsets of collapsed phases, including swollen
phases and can potentially affect the conformational landscape. The
significant increase in attractive van der Waals interaction energy between
the polymer and crowders also supports this notion.

We observe an intriguing phenomenon regarding the $CCI$-$CCB$ phase boundary,
which appears to remain largely unaffected by changes in $A$. This outcome is
unexpected, as one would intuitively anticipate that for higher values of
parameter $A$, the CCI phase’s stability would strengthen, necessitating a
correspondingly larger $\epsilon_{mc}$ to induce its destabilization. If $A$
was indeed analogous to $\epsilon_{mm}$ of neutral polymers, then it might be
anticipated that the critical value of $\epsilon_{mc}$ ($\epsilon_{mc}^{*}$)
would exhibit a linear increase with $A$, as suggested by Garg et al. [62].
The independence of the $CCI$-$CCB$ phase boundary on the variations in
parameter $A$, holds particular significance in the context of theories
surrounding the collapse of charged polymers. Various competing hypotheses,
such as the ionic solid theory, dipole theory, and counterion fluctuation
theory, have been posited to explain the counterintuitive collapse or
aggregation of similarly charged polyelectrolytes (PEs) [18, 19, 20, 30, 31,
32, 33, 34, 27, 17, 35, 21, 22, 23, 36, 25, 28, 15, 37, 35, 86, 91, 92, 38].
In the dipole theory, the parameter $A$ serves to enhance the effective value
of $\epsilon_{mm}$, thereby leading to the prediction of a linear relationship
between $\epsilon_{mc}^{*}$ and $A$, which is in contradiction to our results.
Our previous molecular dynamics simulations corroborate the counterion
fluctuation theory, which argues that the emergent attractive forces are due
to density fluctuations of densely packed counterions moving freely within the
PE globule [18, 19, 20, 28]. How the inclusion of neutral crowders in the
overall picture of PE with counterions affects the predictions of counterion
fluctuation theory would be part of the future study. It is to be noted that,
we previously showed the underlying mechanism that governs the aggregation of
multiple similarly charged PEs when their charge densities exceed the critical
threshold established for the collapse of an individual PE [93, 86, 91]. Thus,
the implications of understanding the role of neutral crowders for aggregation
mechanism of multiple PEs would also be important to understand.

Moreover, the Flory-Huggins theory furnishes predictions regarding the
conformational behavior of neutral polymers, accounting for diverse entropic
and energetic factors influencing the free energy dynamics [94]. However, the
introduction of charges to the polymer structure necessitates the integration
of electrostatic contributions into the free energy, accomplished through a
Debye-Huckel term [95]. Our previous work [19, 20] has demonstrated the
requirement for additional terms within the virial expansion to
comprehensively address the electrostatic influence on the free energy. The
valency of counterions has a significant impact on the attractive volume
interactions within the PE, as it determines the number of condensed
counterions inside the collapsed PE globule [20]. The introduction of
attractive neutral crowders further complicates the scenario, as they compete
with the condensed counterions, thereby enhancing the attractive interactions
between the polymer and the crowders. These contrasting behaviors underscore
the pivotal role played by the counterion valency in shaping the
conformational landscape of charged polymers in the presence of neutral
crowders. This can have profound implications for polymer models used for
understanding phenomena such as chromatin organization and LLPS. Models such
as strings and binders (SBS) [96, 74] or stickers-and-spacers [97] are simple
neutral polymer models (lattice, mean field, etc.) used to describe chromatin
organization, folding, or membraneless organelle formation via LLPS. These
models primarily consider specific interactions with binding molecules,
modeled as simple crowders. We expect significant changes to the understanding
of these systems when the inherent charges of these biopolymers are
incorporated, and the role of counterion valencies and the strength of soft
attraction between biopolymers and crowders are modeled. Understanding how the
introduction of charges in simple polymer models will affect the comparison
with experimental Hi-C data will be part of future work.

##  V Supplementary Material

Additional Data included.

###### Acknowledgements.

The simulations were carried out on the high performance computing machines
Nandadevi at the Institute of Mathematical Sciences.

## References

  * Wong and Pollack [2010] G. C. Wong and L. Pollack, “Electrostatics of strongly charged biological polymers: ion-mediated interactions and self-organization in nucleic acids and proteins,” Annual review of physical chemistry 61, 171–189 (2010).
  * Solis and de la Cruz [2000] F. J. Solis and O. de la Cruz, “Collapse of flexible polyelectrolytes in multivalent salt solutions,” J. Chem. Phys. 112, 2030–2035 (2000).
  * Schneemann [2006] A. Schneemann, “The structural and functional role of rna in icosahedral virus assembly,” Ann. Rev. Microbiol. 60, 51–67 (2006).
  * Siber, Losdorfer Bozic, and Podgornik [2012] A. Siber, A. Losdorfer Bozic, and R. Podgornik, “Energies and pressures in viruses: contribution of nonspecific electrostatic interactions,” Phys. Chem. Chem. Phys. 14, 374–¡80¿¡93¿3765 (2012).
  * Bruinsma  _et al._ [2016] R. F. Bruinsma, M. Comas-Garcia, R. F. Garmann, and A. Y. Grosberg, “Equilibrium self-assembly of small rna viruses,” Phys. Rev. E 93, 032405 (2016).
  * van der Schoot and Bruinsma [2005] P. van der Schoot and R. Bruinsma, “Electrostatics and the assembly of an rna virus,” Phys. Rev. E 71, 061928 (2005).
  * Bloomfield [1991] V. A. Bloomfield, “Condensation of dna by multivalent cations: Considerations on mechanism,” Biopolymers 31, 1471–1481 (1991).
  * Bloomfield [1996] V. A. Bloomfield, “Dna condensation,” Curr. Opin. Struct. Biol. 6, 334–341 (1996).
  * Mitragotri  _et al._ [2015] S. Mitragotri, D. G. Anderson, X. Chen, E. K. Chow, D. Ho, A. V. Kabanov, J. M. Karp, K. Kataoka, C. A. Mirkin, S. H. Petrosko, _et al._ , “Accelerating the translation of nanomaterials in biomedicine,” ACS nano 9, 6644–6654 (2015).
  * Russell  _et al._ [2002] R. Russell, I. S. Millett, M. W. Tate, L. W. Kwok, B. Nakatani, S. M. Gruner, S. G. Mochrie, V. Pande, S. Doniach, D. Herschlag, _et al._ , “Rapid compaction during rna folding,” Proceedings of the National Academy of Sciences 99, 4266–4271 (2002).
  * Buchmueller  _et al._ [2000] K. L. Buchmueller, A. E. Webb, D. A. Richardson, and K. M. Weeks, “A collapsed non-native rna folding state,” Nature Structural & Molecular Biology 7, 362 (2000).
  * Murthy and Rose [2000] V. L. Murthy and G. D. Rose, “Is counterion delocalization responsible for collapse in rna folding?” Biochemistry 39, 14365–14370 (2000).
  * Dias  _et al._ [2003] R. Dias, A. Pais, M. Miguel, and B. Lindman, “Modeling of dna compaction by polycations,” The Journal of chemical physics 119, 8150–8157 (2003).
  * Chauhan and Woodson [2008] S. Chauhan and S. A. Woodson, “Tertiary interactions determine the accuracy of rna folding,” Journal of the American Chemical Society 130, 1296–1303 (2008).
  * Manning [1969] G. S. Manning, “Limiting laws and counterion condensation in polyelectrolyte solutions i. colligative properties,” The Journal of Chemical Physics 51, 924–933 (1969).
  * Manning [2018] G. S. Manning, “Condensation of counterions gives rise to contraction transitions in a one-dimensional polyelectrolyte gel,” Polymers 10, 432 (2018).
  * Varghese, Vemparala, and Rajesh [2011a] A. Varghese, S. Vemparala, and R. Rajesh, “Phase transitions of a single polyelectrolyte in a poor solvent with explicit counterions,” The Journal of chemical physics 135, 154902 (2011a).
  * Brilliantov, Kuznetsov, and Klein [1998] N. V. Brilliantov, D. V. Kuznetsov, and R. Klein, “Chain collapse and counterion condensation in dilute polyelectrolyte solutions,” Phys. Rev. Lett. 81, 1433–1436 (1998).
  * Tom  _et al._ [2016] A. M. Tom, S. Vemparala, R. Rajesh, and N. V. Brilliantov, “Mechanism of chain collapse of strongly charged polyelectrolytes,” Physical review letters 117, 147801 (2016).
  * Tom  _et al._ [2017] A. M. Tom, S. Vemparala, R. Rajesh, and N. V. Brilliantov, “Regimes of electrostatic collapse of a highly charged polyelectrolyte in a poor solvent,” Soft matter 13, 1862–1872 (2017).
  * Stevens and Kremer [1993] M. J. Stevens and K. Kremer, “Structure of salt-free linear polyelectrolytes,” Phys. Rev. Lett. 71, 2228 (1993).
  * Stevens and Kremer [1995] M. J. Stevens and K. Kremer, “The nature of flexible linear polyelectrolytes in salt free solution: A molecular dynamics study,” The Journal of Chemical Physics 103, 1669–1690 (1995).
  * Winkler, Gold, and Reineker [1998] R. G. Winkler, M. Gold, and P. Reineker, “Collapse of polyelectrolyte macromolecules by counterion condensation and ion pair formation: A molecular dynamics simulation study,” Phys. Rev. Lett. 80, 3731–3734 (1998).
  * Mel’nikov  _et al._ [1999a] S. M. Mel’nikov, M. O. Khan, B. Lindman, and B. Jönsson, “Phase behavior of single dna in mixed solvents,” J. Am. Chem. Soc. 121, 1130–1136 (1999a).
  * Deserno and Holm [2002] M. Deserno and C. Holm, “Theory and simulations of rigid polyelectrolytes,” Mol. Phys. 100, 2941–2956 (2002).
  * Varghese, Vemparala, and Rajesh [2011b] A. Varghese, S. Vemparala, and R. Rajesh, “Phase transitions of a single polyelectrolyte in a poor solvent with explicit counterions,” J. Chem. Phys. 135, 154902 (2011b).
  * Dobrynin and Rubinstein [2005] A. V. Dobrynin and M. Rubinstein, “Theory of polyelectrolytes in solutions and at surfaces,” Prog. Poly. Science 30, 1049 – 1118 (2005).
  * Gavrilov, Chertovich, and Kramarenko [2016a] A. A. Gavrilov, A. V. Chertovich, and E. Y. Kramarenko, “Conformational behavior of a single polyelectrolyte chain with bulky counterions,” Macromolecules 49, 1103–1110 (2016a).
  * Gavrilov, Chertovich, and Kramarenko [2016b] A. A. Gavrilov, A. V. Chertovich, and E. Y. Kramarenko, “Dissipative particle dynamics for systems with high density of charges: Implementation of electrostatic interactions,” J. Chem. Phys. 145, 174101 (2016b).
  * Bloomfield [1997] V. A. Bloomfield, “Dna condensation by multivalent cations,” Biopolymers: Original Research on Biomolecules 44, 269–282 (1997).
  * Cherstvy [2010] A. Cherstvy, “Collapse of highly charged polyelectrolytes triggered by attractive dipole- dipole and correlation-induced electrostatic interactions,” The Journal of Physical Chemistry B 114, 5241–5249 (2010).
  * Gordievskaya, Budkov, and Kramarenko [2018] Y. D. Gordievskaya, Y. A. Budkov, and E. Y. Kramarenko, “An interplay of electrostatic and excluded volume interactions in the conformational behavior of a dipolar chain: theory and computer simulations,” Soft matter 14, 3232–3235 (2018).
  * Muthukumar [2004] M. Muthukumar, “Theory of counter-ion condensation on flexible polyelectrolytes: Adsorption mechanism,” The Journal of chemical physics 120, 9343–9350 (2004).
  * Solis and De La Cruz [2000] F. J. Solis and M. O. De La Cruz, “Collapse of flexible polyelectrolytes in multivalent salt solutions,” The Journal of Chemical Physics 112, 2030–2035 (2000).
  * Grosberg and Khokhlov [1994] A. Y. Grosberg and A. R. Khokhlov,  _Statistical Physics of Macromolecules_ (AIP Press, Woodbury, NY, 1994).
  * Mel’nikov  _et al._ [1999b] S. M. Mel’nikov, M. O. Khan, B. Lindman, and B. Jönsson, “Phase behavior of single dna in mixed solvents,” J. Am. Chem. Soc. 121, 1130–1136 (1999b).
  * Khokhlov [1980] A. R. Khokhlov, “On the collapse of weakly charged polyelectrolytes,” J. Phys. A 13, 979–987 (1980).
  * Schiessel and Pincus [1998] H. Schiessel and P. Pincus, “Counterion-condensation-induced collapse of highly charged polyelectrolytes,” Macromolecules 31, 7953–7959 (1998).
  * Rivas, Ferrone, and Herzfeld [2004] G. Rivas, F. Ferrone, and J. Herzfeld, “Life in a crowded world: Workshop on the biological implications of macromolecular crowding,” (2004).
  * Zhou, Rivas, and Minton [2008] H.-X. Zhou, G. Rivas, and A. P. Minton, “Macromolecular crowding and confinement: biochemical, biophysical, and potential physiological consequences,” Annu. Rev. Biophys. 37, 375–397 (2008).
  * Rivas and Minton [2016] G. Rivas and A. P. Minton, “Macromolecular crowding in vitro, in vivo, and in between,” Trends in biochemical sciences 41, 970–981 (2016).
  * Zimmerman and Trach [1991] S. B. Zimmerman and S. O. Trach, “Estimation of macromolecule concentrations and excluded volume effects for the cytoplasm of escherichia coli,” Journal of molecular biology 222, 599–620 (1991).
  * Ellis and Minton [2003] R. J. Ellis and A. P. Minton, “Join the crowd,” Nature 425, 27–28 (2003).
  * Ellis [2001] R. J. Ellis, “Macromolecular crowding: an important but neglected aspect of the intracellular environment,” Current opinion in structural biology 11, 114–119 (2001).
  * Zimmerman and Minton [1993] S. B. Zimmerman and A. P. Minton, “Macromolecular crowding: biochemical, biophysical, and physiological consequences,” Annual review of biophysics and biomolecular structure 22, 27–65 (1993).
  * Nayar [2020] D. Nayar, “Small crowder interactions can drive hydrophobic polymer collapse as well as unfolding,” Physical Chemistry Chemical Physics 22, 18091–18101 (2020).
  * Zangi, Zhou, and Berne [2009] R. Zangi, R. Zhou, and B. Berne, “Urea’s action on hydrophobic interactions,” Journal of the American Chemical Society 131, 1535–1541 (2009).
  * Mardoum  _et al._ [2018] W. M. Mardoum, S. M. Gorczyca, K. E. Regan, T.-C. Wu, and R. M. Robertson-Anderson, “Crowding induces entropically-driven changes to dna dynamics that depend on crowder structure and ionic conditions,” Frontiers in physics 6, 53 (2018).
  * Nakano and Sugimoto [2017] S.-i. Nakano and N. Sugimoto, “Model studies of the effects of intracellular crowding on nucleic acid interactions,” Molecular BioSystems 13, 32–41 (2017).
  * Shin, Cherstvy, and Metzler [2015] J. Shin, A. G. Cherstvy, and R. Metzler, “Kinetics of polymer looping with macromolecular crowding: effects of volume fraction and crowder size,” Soft matter 11, 472–488 (2015).
  * Liu, Jiang, and Hou [2020] X. Liu, H. Jiang, and Z. Hou, “Non-monotonic dependence of polymer chain dynamics on active crowder size,” The Journal of Chemical Physics 152, 204906 (2020).
  * Taylor, Vinci, and Suzuki [2020] M. P. Taylor, C. Vinci, and R. Suzuki, “Effects of macromolecular crowding on the folding of a polymer chain: A wang–landau simulation study,” The Journal of Chemical Physics 153, 174901 (2020).
  * Asakura and Oosawa [1954] S. Asakura and F. Oosawa, “On interaction between two bodies immersed in a solution of macromolecules,” The Journal of chemical physics 22, 1255–1256 (1954).
  * Asakura and Oosawa [1958] S. Asakura and F. Oosawa, “Interaction between particles suspended in solutions of macromolecules,” Journal of polymer science 33, 183–192 (1958).
  * Nayar [2023] D. Nayar, “Molecular crowders can induce collapse in hydrophilic polymers via soft attractive interactions,” The Journal of Physical Chemistry B (2023).
  * Mukherjee and Mondal [2019] M. Mukherjee and J. Mondal, “Osmolyte-induced collapse of a charged macromolecule,” The Journal of Physical Chemistry B 123, 4636–4644 (2019).
  * Tripathi, Menon, and Vemparala [2019] K. Tripathi, G. I. Menon, and S. Vemparala, “Confined crowded polymers near attractive surfaces,” The Journal of Chemical Physics 151 (2019), 244901.
  * Tripathi and Vemparala [2023] K. Tripathi and S. Vemparala, “Conformational landscape of long semiflexible linear and ring polymers near attractive surfaces,” (2023), arXiv:2304.11548 [cond-mat.soft] .
  * Miyazaki  _et al._ [2022] K. Miyazaki, K. Schweizer, D. Thirumalai, R. Tuinier, and E. Zaccarelli, “The asakura–oosawa theory: Entropic forces in physics, biology, and soft matter,” (2022).
  * Bhat and Timasheff [1992] R. Bhat and S. N. Timasheff, “Steric exclusion is the principal source of the preferential hydration of proteins in the presence of polyethylene glycols,” Protein Science 1, 1133–1143 (1992).
  * Kang  _et al._ [2015] H. Kang, P. A. Pincus, C. Hyeon, and D. Thirumalai, “Effects of macromolecular crowding on the collapse of biopolymers,” Physical review letters 114, 068303 (2015).
  * Garg, Rajesh, and Vemparala [2023] H. Garg, R. Rajesh, and S. Vemparala, “The conformational phase diagram of neutral polymers in the presence of attractive crowders,” The Journal of Chemical Physics 158 (2023).
  * Antypov and Elliott [2008] D. Antypov and J. A. Elliott, “Computer simulation study of a single polymer chain in an attractive solvent,” The Journal of chemical physics 129, 174901 (2008).
  * Heyda, Muzdalo, and Dzubiella [2013] J. Heyda, A. Muzdalo, and J. Dzubiella, “Rationalizing polymer swelling and collapse under attractive cosolvent conditions,” Macromolecules 46, 1231–1238 (2013).
  * Rodríguez-Ropero, Hajari, and van der Vegt [2015] F. Rodríguez-Ropero, T. Hajari, and N. F. van der Vegt, “Mechanism of polymer collapse in miscible good solvents,” The Journal of Physical Chemistry B 119, 15780–15788 (2015).
  * Huang and Cheng [2021] Y. Huang and S. Cheng, “Chain conformations and phase separation in polymer solutions with varying solvent quality,” Journal of Polymer Science 59, 2819–2831 (2021).
  * Erdel and Rippe [2018] F. Erdel and K. Rippe, “Formation of chromatin subcompartments by phase separation,” Biophysical journal 114, 2262–2270 (2018).
  * King and Shakya [2021] J. T. King and A. Shakya, “Phase separation of dna: From past to present,” Biophysical Journal 120, 1139–1149 (2021).
  * Ryu, Hwang, and Choi [2021] J.-K. Ryu, D.-E. Hwang, and J.-M. Choi, “Current understanding of molecular phase separation in chromosomes,” International Journal of Molecular Sciences 22, 10736 (2021).
  * Azaldegui, Vecchiarelli, and Biteen [2021] C. A. Azaldegui, A. G. Vecchiarelli, and J. S. Biteen, “The emergence of phase separation as an organizing principle in bacteria,” Biophysical journal 120, 1123–1138 (2021).
  * Ryu  _et al._ [2021] J.-K. Ryu, C. Bouchoux, H. W. Liu, E. Kim, M. Minamino, R. de Groot, A. J. Katan, A. Bonato, D. Marenduzzo, D. Michieletto, _et al._ , “Bridging-induced phase separation induced by cohesin smc protein complexes,” Science Advances 7, eabe5905 (2021).
  * Brackley [2020] C. Brackley, “Polymer compaction and bridging-induced clustering of protein-inspired patchy particles,” Journal of Physics: Condensed Matter 32, 314002 (2020).
  * Brackley  _et al._ [2013] C. A. Brackley, S. Taylor, A. Papantonis, P. R. Cook, and D. Marenduzzo, “Nonspecific bridging-induced attraction drives clustering of dna-binding proteins and genome organization,” Proceedings of the National Academy of Sciences 110, E3605–E3611 (2013).
  * Barbieri  _et al._ [2012] M. Barbieri, M. Chotalia, J. Fraser, L.-M. Lavitas, J. Dostie, A. Pombo, and M. Nicodemi, “Complexity of chromatin folding is captured by the strings and binders switch model,” Proceedings of the National Academy of Sciences 109, 16173–16178 (2012).
  * Murugesapillai  _et al._ [2014] D. Murugesapillai, M. J. McCauley, R. Huo, M. H. Nelson Holte, A. Stepanyants, L. J. Maher III, N. E. Israeloff, and M. C. Williams, “Dna bridging and looping by hmo1 provides a mechanism for stabilizing nucleosome-free chromatin,” Nucleic acids research 42, 8996–9004 (2014).
  * Machida  _et al._ [2018] S. Machida, Y. Takizawa, M. Ishimaru, Y. Sugita, S. Sekine, J.-i. Nakayama, M. Wolf, and H. Kurumizaka, “Structural basis of heterochromatin formation by human hp1,” Molecular cell 69, 385–397 (2018).
  * Malhotra, Oyarzún, and Mognetti [2021] I. Malhotra, B. Oyarzún, and B. M. Mognetti, “Unfolding of the chromatin fiber driven by overexpression of noninteracting bridging factors,” Biophysical journal 120, 1247–1256 (2021).
  * Brackley and Marenduzzo [2020] C. A. Brackley and D. Marenduzzo, “Bridging-induced microphase separation: photobleaching experiments, chromatin domains and the need for active reactions,” Briefings in functional genomics 19, 111–118 (2020).
  * Biedzinski, Parmar, and Weber [2020] S. Biedzinski, B. Parmar, and S. C. Weber, “Beyond equilibrium phase diagrams: enzymatic activity shakes up bacterial condensates,” Molecular cell 79, 205–206 (2020).
  * Plimpton [1995] S. Plimpton, “Fast parallel algorithms for short-range molecular dynamics,” Journal of computational physics 117, 1–19 (1995).
  * Verlet [1967] L. Verlet, “Computer” experiments” on classical fluids. i. thermodynamical properties of lennard-jones molecules,” Physical review 159, 98 (1967).
  * Swope  _et al._ [1982] W. C. Swope, H. C. Andersen, P. H. Berens, and K. R. Wilson, “A computer simulation method for the calculation of equilibrium constants for the formation of physical clusters of molecules: Application to small water clusters,” The Journal of Chemical Physics 76, 637–649 (1982).
  * Nosé [1984] S. Nosé, “A unified formulation of the constant temperature molecular dynamics methods,” The Journal of chemical physics 81, 511–519 (1984).
  * Hoover [1985] W. G. Hoover, “Canonical dynamics: Equilibrium phase-space distributions,” Physical review A 31, 1695 (1985).
  * Hockney and Eastwood [2021] R. W. Hockney and J. W. Eastwood,  _Computer simulation using particles_ (crc Press, 2021).
  * Tom, Rajesh, and Vemparala [2017] A. M. Tom, R. Rajesh, and S. Vemparala, “Aggregation of flexible polyelectrolytes: Phase diagram and dynamics,” The Journal of chemical physics 147, 144903 (2017).
  * Dima [2004] R. I. Dima, “Asymmetry in the shapes of folded and denatured states of proteins,” The Journal of Physical Chemistry B 108, 6564–6570 (2004).
  * Theodorou and Suter [1985] D. N. Theodorou and U. W. Suter, “Shape of unperturbed linear polymers: polypropylene,” Macromolecules 18, 1206–1214 (1985).
  * Minton [1981] A. P. Minton, “Excluded volume as a determinant of macromolecular structure and reactivity,” Biopolymers: Original Research on Biomolecules 20, 2093–2120 (1981).
  * Speer  _et al._ [2022] S. L. Speer, C. J. Stewart, L. Sapir, D. Harries, and G. J. Pielak, “Macromolecular crowding is more than hard-core repulsions,” Annual Review of Biophysics 51, 267–300 (2022).
  * Tom, Rajesh, and Vemparala [2016] A. M. Tom, R. Rajesh, and S. Vemparala, J. of Chem. Phys. 144, 034904 (2016).
  * Varghese, Rajesh, and Vemparala [2012a] A. Varghese, R. Rajesh, and S. Vemparala, “Aggregation of rod-like polyelectrolyte chains in the presence of monovalent counterions,” The Journal of chemical physics 137, 234901 (2012a).
  * Varghese, Rajesh, and Vemparala [2012b] A. Varghese, R. Rajesh, and S. Vemparala, “Aggregation of rod-like polyelectrolyte chains in the presence of monovalent counterions,” J. of Chem. Phys. 137, 234901 (2012b).
  * De Gennes and Gennes [1979] P.-G. De Gennes and P.-G. Gennes,  _Scaling concepts in polymer physics_ (Cornell university press, 1979).
  * Overbeek and Voorn [1957] J. T. G. Overbeek and M. Voorn, “Phase separation in polyelectrolyte solutions. theory of complex coacervation,” Journal of Cellular and Comparative Physiology 49, 7–26 (1957).
  * Chiariello  _et al._ [2016] A. M. Chiariello, C. Annunziatella, S. Bianco, A. Esposito, and M. Nicodemi, “Polymer physics of chromosome large-scale 3d organisation,” Scientific reports 6, 29775 (2016).
  * Choi, Holehouse, and Pappu [2020] J.-M. Choi, A. S. Holehouse, and R. V. Pappu, “Physical principles underlying the complex biology of intracellular phase transitions,” Annual review of biophysics 49, 107–133 (2020).


$J_{T,2}^{\text{Di-Di}}$    $20.38^{+0.11}_{-0.18}$    $446.(\pm 5\%)$    $10.00(\pm 5\%)$       $19.39^{+0.23}_{-1.89}$    $386.(\pm 5\%)$    $5.00(\pm 5\%)$

$J_{T,3}^{\text{Di-Di}}$    $19.68^{+0.04}_{-0.10}$    $420.(\pm 5\%)$    $7.50(\pm 5\%)$       $18.98^{+0.07}_{-0.28}$    $366.(\pm 5\%)$    $3.50(\pm 5\%)$
$J_{T,1}^{\text{Dia}}$    $19.67^{+0.04}_{-0.09}$    $418.(\pm 5\%)$    $7.50(\pm 5\%)$       $18.98^{+0.07}_{-0.29}$    $366.(\pm 5\%)$    $3.50(\pm 5\%)$

$J_{T,2}^{\text{Dia}}$    $19.68^{+0.04}_{-0.10}$    $420.(\pm 5\%)$    $7.50(\pm 5\%)$       $18.98^{+0.07}_{-0.28}$    $366.(\pm 5\%)$    $3.50(\pm 5\%)$

$J_{T,3}^{\text{Dia}}$    $19.68^{+0.04}_{-0.10}$    $420.(\pm 5\%)$    $7.50(\pm 5\%)$       $18.98^{+0.07}_{-0.28}$    $366.(\pm 5\%)$    $3.50(\pm 5\%)$

The Borel platform curves for $J_{T,1}^{\text{Dia}}$ with $\bar{b}b\bar{b}b$ system in the $\overline{\text{MS}}$ and On-Shell schemes

The Borel platform curves for $J_{T,2}^{\text{Dia}}$ with $\bar{b}b\bar{b}b$ system in the $\overline{\text{MS}}$ and On-Shell schemes

The Borel platform curves for $J_{T,3}^{\text{Dia}}$ with $\bar{b}b\bar{b}b$ system in the $\overline{\text{MS}}$ and On-Shell schemes

§.§ Renormalization scale dependence

The renormalization scale $\mu$ dependence of the LO and NLO results of $J_{S,3}^{\text{Dia}}$ in $\overline{\text{MS}}$ scheme

The renormalization scale $\mu$ dependence of the LO and NLO results of $J_{S,4}^{\text{Dia}}$ in $\overline{\text{MS}}$ scheme


higher than those for category 3 patients, which are 4.5 to 5.5 times higher
than those for category 4 patients. Interestingly, this changes for the TWT
objective, where category 3 patients have significantly less weight compared
to other first consultation weights. As a result, category 3 patients may less
frequently “overtake” category 2 patients and more frequently be “overtaken”
by category 4 patients.

As could have been expected, the sum of weights assigned to second
consultation queues is significantly lower for the TTDL objective and
significantly higher for the TWT objective compared to combined measures.

The weights for scenarios with either altering variance or higher arrival rate
show a similar behavior to the weights for the base scenario an the C-15
objective. Only for the HR (increased arrival rate) scenario is the
$\beta_{5,1}$ weight significantly lower. This may result from the observation
that for a system under severe stress, i.e. longer queue lengths, it is harder
to meet TTD targets for patients of higher priority.

The weight structure significantly changes for the T3 scenario (a peak of
category 3 patients). Interestingly, the weight for the first consultation of
category 2 patients is approximately 4.6 times higher than for category 3
patients. The large number of category 3 patients will most likely result in
longer waiting times of those patients. Hence, the larger gap between weights
may prevent too frequent overtaking of category 3 patients. On the other side,
$\beta_{3,1}$ is approximately 8 times higher than $\beta_{4,1}$ for scenario
T3. This may be also explained by more crowded $Q_{3,1}$ queues in this
scenario, compared to the base scenario. The sum of weights for the second
consultation is significantly lower compared to other configurations, as a
larger number of “higher” priority patients negatively impacts the TTD rates
more than the overall waiting time. As would be expected, weight distributions
for the T5 scenario assign higher weights to category 5 patients. In addition,
the sum of weights for the second consultation is higher than for all other
scenarios based on the C-15 objective. An intuitive explanation might be that
it is necessary to reduce the waiting times for the second consultation of
higher priority patients, in order to limit the waiting times for category 5
patients.

###  A.2 Feature Engineering

To train an ML model for patient selection from decisions made by near optimal
schedules of ED instances, one is required to define a state representation of
the ED at the time a decision was made. This state representation can then be
used as a set of features to form a sample for the ML model. This sample is
then composed by the feature set and the recorded response, i.e. the (near)
optimal decision at the considered point in time $t$. To formally describe the
set of features, let $P_{q}$ be the set of patients waiting in
$q\in\\{Q_{2,1},Q_{3,1},Q_{4,1},Q_{5,1},Q^{d}_{2,2},Q^{d}_{3,2},Q^{d}_{4,2},Q^{d}_{5,2}\\}$
for doctor $d$ and, let $p_{q}^{1}$, $p_{q}^{l}$ and $p_{q}^{m}$ be the first,
last and median patient waiting in queue $q$. Further, for a patient $p$
waiting in queue $q$ for first consultation, let $\hat{ttd}^{p}$ be the
“current” time to doctor at time $t$, i.e. $\hat{ttd}^{p}=t-t_{a}^{p}$, as the
real $ttd^{p}$ is only known upon the selection of patient $p$ for first
consultation by doctor $d$. Waiting time measures $\hat{W}_{1}^{p}$ and
$\hat{W}^{p}$ are defined accordingly as the waiting time that has been
accumulated up to time $t$. Finally, let $I_{X}(x)$ be the index function that
is $1$ if $x\in X$ and $0$ otherwise.

The set of feature may be divided into the following classes: general
features, features concerning queues for the first consultation, feature
concerning queues for the second consultation, and features concerning the
register, triage and diagnostic activities. The entire feature set is outlined
in Table 14.

Definition |  Description
---|---
General Features
$t$ |  Time of the day the decision was made
$d$ |  Identifier of doctor
$|D_{idle}|$ |  Number of idle doctors at time $t$
$|\\{p\in P_{j}|t_{a}^{p}\leq t\wedge\hat{ttd}^{p}\geq t_{ttd}^{j}\\}|$ |  Number of category $j$ patients that arrived before $t$ and missed the target time ($j\in J$)
$|\\{p\in P_{j}|t_{a}^{p}\leq t\\}|$ |  Number of category $j$ patients that arrived before $t$ ($j\in J$)
First Consultation Queue Features for queue $Q_{j,1},j\in J$
$|P_{Q_{j,1}}|$ |  The length of queue $Q_{j,1}$
$\hat{ttd}^{p_{Q_{j,1}}^{1}}$ |  The current time to doctor of the first patient in queue $Q_{j,1}$
$\hat{ttd}^{p_{Q_{j,1}}^{l}}$ |  The current time to doctor of the last patient in queue $Q_{j,1}$
$\hat{ttd}^{p_{Q_{j,1}}^{m}}$ |  The current time to doctor of the median patient in queue $Q_{j,1}$
$\sum_{p\in P_{Q_{j,1}}}\hat{ttd}^{p}/|P_{Q_{j,1}}|$ |  The average current time to doctor of patients in queue $Q_{j,1}$
$|P_{Q_{j,1}}|$ |  The length of queue $Q_{j,1}$
$\hat{W}_{1}^{p_{Q_{j,1}}^{1}}$ |  The total waiting time of the first patient in queue $Q_{j,1}$
$\hat{W}_{1}^{p_{Q_{j,1}}^{l}}$ |  The total waiting time of the last patient in queue $Q_{j,1}$
$\hat{W}_{1}^{p_{Q_{j,1}}^{m}}$ |  The total waiting time of the median patient in queue $Q_{j,1}$
$\sum_{p\in P_{Q_{j,1}}}\hat{W}_{1}^{p}/|P_{Q_{j,1}}|$ |  The average total waiting time of patients in queue $Q_{j,1}$
$\sum_{p\in P_{Q_{j,1}}}I_{[t_{ttd}^{j},\infty)}(\hat{ttd}^{p})$ |  Number of patients in queue that missed the target time to doctor
$\sum_{p\in P_{Q_{j,1}}}I_{[t_{ttd}^{j}-5,t_{ttd}^{j})}(\hat{ttd}^{p})$ |  Number of patients that need to be seen in the next 5 minutes to meet the target
$\sum_{p\in P_{Q_{j,1}}}I_{[t_{ttd}^{j}-10,t_{ttd}^{j}-5)}(\hat{ttd}^{p})$ |  Number of patients that need to be seen between 5 and 10 minutes to meet the target
$\sum_{p\in P_{Q_{j,1}}}I_{[t_{ttd}^{j}-15,t_{ttd}^{j}-10)}(\hat{ttd}^{p})$ |  Number of patients that need to be seen between 10 and 15 minutes to meet the target
$\sum_{p\in P_{Q_{j,1}}}I_{[t_{ttd}^{j}-20,t_{ttd}^{j}-15)}(\hat{ttd}^{p})$ |  Number of patients that need to be seen between 15 and 20 minutes to meet the target, for $j\geq 3$
$\sum_{p\in P_{Q_{j,1}}}I_{[t_{ttd}^{j}-30,t_{ttd}^{j}-20)}(\hat{ttd}^{p})$ |  Number of patients that need to be seen between 20 and 30 minutes to meet the target, for $j\geq 4$
$\sum_{p\in P_{Q_{j,1}}}I_{[t_{ttd}^{j}-40,t_{ttd}^{j}-30)}(\hat{ttd}^{p})$ |  Number of patients that need to be seen between 30 and 40 minutes to meet the target, for $j\geq 4$
Second Consultation Queue Features for queue $Q^{d}_{j,2},j\in J$
$\hat{W}^{p_{Q^{d}_{j,2}}^{1}}$ |  The total waiting time of the first patient in queue $Q^{d}_{j,2}$
$\hat{W}^{p_{Q^{d}_{j,2}}^{l}}$ |  The total waiting time of the last patient in queue $Q^{d}_{j,2}$
$\hat{W}^{p_{Q^{d}_{j,2}}^{m}}$ |  The total waiting time of the median patient in queue $Q^{d}_{j,2}$
$\sum_{p\in P_{Q^{d}_{j,2}}}\hat{W}^{p}/|P_{Q^{d}_{j,2}}|$ |  The average total waiting time of patients in queue $Q^{d}_{j,2}$
Register, Triage and Diagnostic Features
$|P_{Test}|$ |  Number of patients at diagnostics at time $t$
$|P^{d}_{Test}|$ |  Number of patients at diagnostics at time $t$ that were first seen by doctor $d$
$|P_{Register,Triage}|$ |  Number of patients either waiting for or are in Register/Triage activities at time $t$
Table 14: Summary of Feature Definitions

  *[EDs]: Emergency Department
  *[APQ]: Accumulated Priority Queuing
  *[ML]: Machine Learning
  *[ED]: Emergency Department
  *[LOS]: Length of Stay
  *[TTD]: Time to Doctor
  *[KPI]: Key Performance Indicator
  *[KPIs]: Key Performance Indicator
  *[ESI]: Emergency Severity Index
  *[MCC]: Matthews Correlation Coefficient


[4.0]by

# WebSHAP: Towards Explaining Any Machine Learning Models Anywhere

Zijie J. Wang  0000-0003-4360-1423<EMAIL_ADDRESS>Georgia Institute of
TechnologyAtlantaGeorgiaUSA and  Duen Horng Chau  0000-0001-9824-3323
<EMAIL_ADDRESS>Georgia Institute of TechnologyAtlantaGeorgiaUSA

(2023)

###### Abstract.

As machine learning (ML) is increasingly integrated into our everyday Web
experience, there is a call for transparent and explainable web-based ML.
However, existing explainability techniques often require dedicated backend
servers, which limit their usefulness as the Web community moves toward in-
browser ML for lower latency and greater privacy. To address the pressing need
for a client-side explainability solution, we present WebSHAP, the first in-
browser tool that adapts the state-of-the-art model-agnostic explainability
technique SHAP to the Web environment. Our open-source tool is developed with
modern Web technologies such as WebGL that leverage client-side hardware
capabilities and make it easy to integrate into existing Web ML applications.
We demonstrate WebSHAP in a usage scenario of explaining ML-based loan
approval decisions to loan applicants. Reflecting on our work, we discuss the
opportunities and challenges for future research on transparent Web ML.
WebSHAP is available at https://github.com/poloclub/webshap.

Machine Learning, Interpretability, W3C, Web Technology

††journalyear: 2023††copyright: cc††conference: Companion Proceedings of the
ACM Web Conference 2023; April 30-May 4, 2023; Austin, TX, USA††booktitle:
Companion Proceedings of the ACM Web Conference 2023 (WWW ’23 Companion),
April 30-May 4, 2023, Austin, TX, USA††doi: 10.1145/3543873.3587362††isbn:
978-1-4503-9419-2/23/04††ccs: Computing methodologies Machine learning

Fig. 1.  WebSHAP is the first open-source tool for explaining any machine
learning (ML) models in browsers. Adopting the state-of-the-art explainability
technique Kernel SHAP to the Web, WebSHAP offers private, ubiquitous, and
interactive explanations. For example, researchers can use WebSHAP to build a
client-side application that explains ML-based loan approval decisions to
applicants, increasing their trust in ML models. (A) With this application,
users can experiment with different feature inputs through the Web UI. (B) The
application then updates the model prediction via in-browser inference. (C)
WebSHAP leverages modern Web technologies to compute feature importance in
real time, delivering interactive and engaging explanations.

A screenshot of a tool Loan Explainer that is developed using WebSHAP to
explain a bank’s loan approval decisions.

##  1\. Introduction

Machine Learning (ML) is now an integral part of our daily Web experiences,
from social media feed ranking (Jamali and Lakshmanan, 2013), fraud detection
(Pandit et al., 2007), to accessibility (Qian et al., 2021). To enrich web
applications with cutting-edge ML capabilities, there has been an increasing
interest in client-side ML technologies. For example, W3C has recently
launched the Web ML Working Group to develop standards to enable in-browser ML
inferences with access to client-side capabilities. By offloading data
processing to on-device hardware, users can enjoy ML-enriched web applications
with lower latency and greater privacy.

Grounding in W3C’s mission of “ensuring the long-term growth of the Web”, the
Web ML working group has adopted UNESCO AI ethical principles (UNESCO, 2021)
as the ethical principles for Web ML (Fletcher and Kostiainen, 2022). A key
principle is “Transparency and Explainability,” stating that Web ML developers
should make their models explainable, inform users with reasons why an ML
model makes certain decisions, and offer users means to contest and correct
Ml-based decisions. However, as ML models become increasingly complex, they
can behave like black boxes, making it challenging to understand how they make
predictions (Wortman Vaughan and Wallach, 2022). This black-box challenge is
even greater on the Web, as existing explainability techniques are
computationally expensive and require dedicated servers (e.g., Ribeiro et al.,
2016; Lundberg and Lee, 2017). How can we explain ML models on the Web and
improve users’ Web experience?

To tackle this pressing challenge on the Web, we present WebSHAP (Fig. 1), the
first in-browser tool that offloads ML explainability to the client—empowering
Web users to explain any ML models anywhere. Our work makes the following key
contributions:

  * •

WebSHAP, the first in-browser tool that enables users to explain any ML
predictions on the Web. Our tool adapts the state-of-the-art model-agnostic
explainability technique Kernel SHAP (Lundberg and Lee, 2017) to the Web
environment. Kernel SHAP uses a game theoretic approach to compute feature
importance for ML predictions. Developed with modern Web technologies, such as
WebGL, WebSHAP harnesses client-side hardware capabilities to generate ML
explanations with both privacy and low latency (§ 3).

  * •

A usage scenario of explaining ML models on the Web. We demonstrate WebSHAP’s
capabilities in a scenario where a bank develops a client-side application
Loan Explainer111Loan Explainer is available at
https://poloclub.github.io/webshap/?model=tabular, open sourced at
https://github.com/poloclub/webshap/tree/main/examples/demo to explain ML-
based loan approval decisions to applicants (§ 2). We highlight the benefits
of on-device explainability regarding privacy, ubiquity, and interactivity
(Horton et al., 2022). Finally, we reflect on the opportunities and challenges
for future research on transparent Web ML (§ 5).

  * •

An open-source implementation that lowers the barrier to applying
explainability techniques to understand ML behaviors on the Web. We provide
comprehensive documentation and examples to help developers easily adapt
WebSHAP to different Web environments. We develop WebSHAP using TypeScript, a
statically typed programming language that enables more maintainable and
scalable code and allows users to easily integrate WebSHAP into their Web ML
applications (§ 3.3).

In pursuit of the “View Source” ethos of the Web, WebSHAP sheds light on
transparent Web ML and provides a foundation for future researchers to develop
trustworthy ML technologies on the Web.

##  2\. WebSHAP in Action

We present a hypothetical usage scenario to demonstrate how WebSHAP can help
Giulia, a Web developer at a bank, to explain ML-based loan approval decisions
to loan applicants such as Luca.

Banks Explaining Loan Approval Decisions.. Giulia develops a Web application
Loan Explainer that helps loan applicants understand how the bank uses ML to
make loan application decisions (Fig. 1). Her bank trained an XGBoost
classifier (Chen and Guestrin, 2016) on past data (we use LendingClub (Len,
2018) in this scenario). This dataset contains 9 continuous features and 7
categorical features with a binary label indicating whether a person pays back
their loan in time. Loan Explainer allows users to enter input features (Fig.
1A) and observe how they affect the predicted loan approval likelihood (Fig.
1B).

Developing Explanable Web ML.. To protect end-users’ privacy, the bank
requires the tool to fully run on the client side, allowing end-users to
securely enter sensitive financial information. To meet this goal, Giulia
converts the XGBoost model from Python to ONNX format, an open and
interoperable ML model representation (Bai et al., 2019). She then uses the
ONNX Web Runtime to run the model inference in browsers with WebAssembly and
Web Workers. To help end-users make sense of the model’s predictions, Giulia
uses WebSHAP to explain the model in browsers. She installs WebSHAP through
npm with only one command, and integrates it into Loan Explainer in under 10
minutes by (1) writing a JavaScript function to wrap the model inference code,
(2) computing missing feature values (required by the Kernel SHAP algorithm)
with training data median, (3) and passing the user-entered data to WebSHAP.
Finally, Giulia visualizes the features’ importance scores in a bar chart
(Fig. 1C).

Loan Applicants Interpreting Web ML.. Luca is a prospective loan applicant who
uses Loan Explainer to explore how banks use ML models for loan approval
decisions. He opens the tool in the browser on his tablet and clicks the
refresh icon  several times until finding a preset applicant profile similar
to his. The tool updates the model’s rejection decision and explanations this
decision in real time. By studying the feature importance bar chart and
observing the changes in predictions after adjusting features, Luca discovers
the significance of the  in loan decision. Impressed by the transparency of
Giulia’s bank, Luca decides to apply for a loan there after boosting his
above 700.

##  3\. System Design and Implementation

WebSHAP is the first tool for explaining any ML models on the Web. To generate
explanations with efficiency and privacy, it leverages the state-of-art
explainability technique Kernel SHAP (§ 3.1) and harnesses modern Web
technologies, such as WebGL, WebAssembly, and Web Workers (§ 3.2). To help
researchers and developers easily adopt WebSHAP, we open-source our
implementation and provide comprehensive documentation and tutorials (§ 3.3).

###  3.1. Adapting Kernel SHAP

SHAP is a state-of-art ML explainability framework popularized by Lundberg and
Lee (2017). It uses the concept of Shapley values, originally applied in
cooperative game theory for credit allocation (Shapley, 1953), to calculate
attribution scores for each feature for an individual ML prediction. Shapley
values are the average contribution of a player in all possible game
coalitions. In an ML context, players are input features, and game coalitions
are permutations of input features compared to a baseline value. Computing
Shapley values is exponentially expensive, as one needs to iterate through all
$2^{M}$ coalitions (permutations) of $M$ players (input features).

To more efficiently compute Shapley values, Lundberg and Lee (2017) introduce
Kernel SHAP, a model-agnostic method to approximate the Shapley values of
feature $x$ by solving a least squares problem $L$ through a linear regression
$g$ with a kernel weight $\pi$.

(1)
$\displaystyle\begin{split}&{\color[rgb]{0.92578125,0.25,0.4765625}L\left({\color[rgb]{0,0,0}f},{\color[rgb]{0.09765625,0.4609375,0.82421875}g},{\color[rgb]{0.984375,0.55078125,0}\pi_{x}}\right)}=\sum_{z^{\prime}\in{}Z}\left[{\color[rgb]{0,0,0}f\left(h_{x}\left(z^{\prime}\right)\right)}-{\color[rgb]{0.09765625,0.4609375,0.82421875}g(z^{\prime})}\right]^{2}{\color[rgb]{0.984375,0.55078125,0}\pi_{x}\left(z^{\prime}\right)}\\\
&{\color[rgb]{0.09765625,0.4609375,0.82421875}g\left(z^{\prime}\right)}={\color[rgb]{0,0.5390625,0.48046875}\phi_{0}}+\sum_{j=1}^{M}{\color[rgb]{0,0.5390625,0.48046875}\phi_{j}}z_{j}^{\prime}\hskip
12.0pt{\color[rgb]{0.984375,0.55078125,0}\pi_{x}\left(z^{\prime}\right)}=\frac{\left(M-1\right)}{\binom{M}{\left|z^{\prime}\right|}\left|z^{\prime}\right|\left(M-\left|z^{\prime}\right|\right)}\end{split}$

Here, $f$ is the ML model that we want to explain, and
$f\left(h_{x}\left(z^{\prime}\right)\right)$ is the model’s predictions on the
sampled data $h_{x}\left(z^{\prime}\right)$, where each row contains features
masked as missing ($z^{\prime}_{j}=0$). Users can specify the values to
represent missing features through $h_{x}$, such as filling them with zeros, a
subset of training data, or the median of training data. The explanation model
${\color[rgb]{0.09765625,0.4609375,0.82421875}g\left(z^{\prime}\right)}$ is a
linear function of binary variables $z^{\prime}\in\\{0,1\\}^{M}$, where $M$ is
the number of input features. The kernel $\pi_{x}\left(z^{\prime}\right)$
assigns a scalar weight to each sampled instance $z^{\prime}$ based on the
number of non-missing features $\left|z^{\prime}\right|$. Finally, the least
squares problem’s estimated solutions $\phi_{j}$ are the Shapley values.

We use Kernel SHAP as the explainability technique in WebSHAP because it is
state-of-the-art (Han et al., 2022) and model-agnostic. This means with our
tool, users can explain the predictions of any ML model available on the Web,
regardless of its architecture or implementation details. Additionally, Kernel
SHAP is the most favored explainability technique among ML practitioners
according to a recent survey (Krishna et al., 2022). By using Kernel SHAP, we
aim to make it easier for developers and researchers to adopt WebSHAP and to
provide them with the best explanations for their Web ML models.

###  3.2. Optimizing for the Web

Dataset Sampling.. Solving the weighted least square problem in Equation 1 can
be computationally challenging, as there are $2^{M}$ feature permutations
($|Z|=2^{M}$). WebSHAP tackles this challenge by implementing a dataset
sampling strategy as described in (Lundberg and Lee, 2017) and leveraging
modern Web technologies. First, WebSHAP avoids sampling permutations for
features with identical input and missing values, as their Shapley values will
always be zero. When dealing with input data with many features ($M>30$),
WebSHAP does not sample all feature permutations: it prioritizes permutations
with a large or small $|z^{\prime}|$, as these instances have a larger kernel
weight $\pi_{x}\left(z^{\prime}\right)$, and thus provide more contribution to
the solutions $\phi_{j}$.

Leveraging Modern Web Technologies.. WebSHAP employs the latest advancements
in Web technologies and tooling to provide efficient and effective
explanations of Web ML models. For example, when solving the weighted least
square problem, WebSHAP uses WebGL to accelerate matrix multiplications
through TensorFlow.js (Smilkov et al., 2019), where matrices are stored as
WebGL textures and matrix multiplication is implemented in a WebGL shader. For
instance, using the FireFox browser on a MacBook, WebSHAP only takes about
600ms to multiply two matrices with dimensions of $2134\times 2134$ through
WebGL, a significant improvement from the 18 seconds it would take without
WebGL. Additionally, we provide examples that use Web Workers to run WebSHAP
in background threads to ensure that the Shapley value computation does not
block the UI thread in browsers. Finally, WebSHAP is model-agnostic and
capable of explaining any ML models available on the Web, including models
compiled from non-Web languages. One can even use WebSHAP to explain an ML
model running in a WebAssembly sandbox environment (e.g., the ML models in § 2
and in ‡ A).

###  3.3. Open-source and Easy to Use

To help Web developers and researchers easily adopt WebSHAP, we open source
our implementation and design an API similar to the Kernel SHAP’s Python
implementation (Lundberg and Lee, 2017). With WebSHAP, explaining a Web ML
model’s prediction is as simple as two lines of code by passing a JavaScript
prediction function, the missing feature values, and the data point. Users
also have the option to easily configure the number of feature permutations to
sample ($|Z|$ in Equation 1). Developed with TypeScript, our tool offers
maintainable and scalable code, allowing users to easily extend and adapt it
for their existing applications. We provide detailed documentation and
tutorials.222WebSHAP documentation: https://poloclub.github.io/webshap/doc We
publish WebSHAP in the popular Web package repository npm Registry.333WebSHAP
npm repository: https://www.npmjs.com/package/webshap Users can easily install
our tool and use it in both browser and Node.js (Dahl, 2009) environments.

##  4\. Related Work

Model-agnostic Explanation Methods.. Researchers have proposed a wide array of
model-agnostic explanation techniques (e.g., Ribeiro et al., 2016, 2018;
Lundberg and Lee, 2017). Given a trained ML model and a data point, these
techniques aim to explain how different features contribute to the model’s
prediction. Users can apply these techniques to any model class. A recent
survey with ML practitioners (Krishna et al., 2022) shows Kernel SHAP
(Lundberg and Lee, 2017), which approximates feature attributions using a game
theoretic approach, is the most favored technique. Based on Kernel SHAP,
researchers have proposed methods such as SAGE (Covert et al., 2020) for
estimating global feature importance and shapr (Aas et al., 2021) for models
with many dependent features. Advancing these related tools, our work is the
first adaptation of Kernel SHAP for the Web.

Explainable ML on the Web.. The Web is a popular platform for explainable ML
tools. To help ML novices learn about the inner workings of modern ML
technologies, researchers develop Web-based visualization tools to
interactively explain how different ML models work, such as GAN Lab (Kahng et
al., 2019) and CNN Explainer (Wang et al., 2020). Researchers have also built
web-based visual analytics tools to empower ML experts to interpret their
models (e.g., Tenney et al., 2020; Wexler et al., 2019; Wang et al., 2022b).
However, these tools often require dedicated backend servers to run ML models.
More recently, there is a growing number of explainability tools that can run
entirely in the user’s browser. For example, with pre-computation, Microscope
(Schubert et al., 2020) allows users to analyze neuron representations in
their browsers. GAM Changer (Wang et al., 2022a), a web-based tool to help
users vet and fix the inherently interpretable Generalized Additive Models by
running mode inference with WebAssembly. In contrast, WebSHAP does not need
backend servers or pre-computation, providing complete in-browser model
explanations for any model class.

##  5\. Discussion and Future Work

Reflecting on our development of WebSHAP, we highlight the advantages and
limitations of transparent and explainable Web ML.

Advantages and Opportunities.. The key benefits of enabling ML explainability
on the Web are privacy, ubiquity, and interactivity. WebSHAP empowers users to
interpret Web ML models directly on their devices, keeping sensitive model
inputs secure (e.g., financial and medical information). As the Web is
ubiquitous, users can use WebSHAP on their computers, tablets, phones, and
even IoT devices (e.g., smart refrigerators). Using the Web as a platform,
WebSHAP makes it easier for developers to deploy explainable ML systems and
enable user interactions. Future research opportunities include:

  * •

Enhancing WebSHAP with new Web APIs such as Service Worker for offline
explainability, WebSocket for collaborative interpretations, and Web Crypto
for verifiable explanations.

  * •

Integrating WebSHAP directly into browsers such as through the Web Inspector
tools. It will allow users to easily view and interpret any ML models running
on a Web page.

  * •

Developing web-based interactive visualization tools to help end-users easily
digest model explanations.

Limitations and Challenges.. We first acknowledge the limitations of using a
post-hoc explainability technique, as it can produce inaccurate and unstable
explanations (Rudin, 2019). Also, developing explainable ML models for the Web
faces unique challenges, including limited computation resources in browsers,
varying capacities among edge devices, and a lack of established Web ML APIs
and libraries. With the ML model in § 2, we compare average SHAP computation
times between WebSHAP and Kernel SHAP (Python) across different background
data size $N$ on a 64GB RAM MacBook (see right). WebSHAP is slower than Kernel
SHAP especially when $N$ is large, and the main factor is the XGBoost
inference time difference.

##  6\. Conclusion

We present WebSHAP, an in-browser, open-source explainability library for Web
ML. Our tool adapts Kernel SHAP and leverages modern Web technologies for easy
integration into existing Web ML applications. To demonstrate its potential,
we present a usage scenario demonstrating real-time explanation of a web-based
loan approval prediction model. In pursuit of the “View Source” ethos of the
Web, we aim for WebSHAP to be a stepping stone towards transparent,
explainable, and trustworthy ML on the Web.

###### Acknowledgements.

This work was supported in part by a J.P. Morgan PhD Fellowship, Apple
Scholars in AI/ML PhD fellowship, and DARPA GARD.

## References

  * (1)
  * Len (2018) 2018\.  Lending Club: Online Personal Loans at Great Rates.  https://www.lendingclub.com/
  * Aas et al. (2021) Kjersti Aas, Martin Jullum, and Anders Løland. 2021\.  Explaining Individual Predictions When Features Are Dependent: More Accurate Approximations to Shapley Values.  _Artificial Intelligence_ 298 (2021).
  * Bai et al. (2019) Junjie Bai, Fang Lu, and Ke Zhang. 2019.  ONNX: Open Neural Network Exchange.
  * Chen and Guestrin (2016) Tianqi Chen and Carlos Guestrin. 2016.  XGBoost: A Scalable Tree Boosting System. In _KDD_.
  * Covert et al. (2020) Ian Covert, Scott M Lundberg, and Su-In Lee. 2020\.  Understanding Global Feature Contributions with Additive Importance Measures. In _Advances in Neural Information Processing Systems_ , Vol. 33.
  * Dahl (2009) Ryan Dahl. 2009\.  Node.Js: An Open-Source, Cross-Platform JavaScript Runtime Environment.  (2009).  https://nodejs.org/en/
  * Fletcher and Kostiainen (2022) James Fletcher and Anssi Kostiainen. 2022.  Ethical Principles for Web Machine Learning.  https://www.w3.org/TR/webmachinelearning-ethics/
  * Han et al. (2022) Tessa Han, Suraj Srinivas, and Himabindu Lakkaraju. 2022\.  Which Explanation Should I Choose? A Function Approximation Perspective to Characterizing Post Hoc Explanations.  _arXiv:2206.01254_ (2022).
  * Horton et al. (2022) Maxwell Horton, Yanzi Jin, Ali Farhadi, and Mohammad Rastegari. 2022.  Layer-Wise Data-Free CNN Compression. In _ICPR_.
  * Jamali and Lakshmanan (2013) Mohsen Jamali and Laks Lakshmanan. 2013.  HeteroMF: Recommendation in Heterogeneous Information Networks Using Context Dependent Factor Models. In _Proceedings of the 22nd International Conference on World Wide Web_.
  * Kahng et al. (2019) Minsuk Kahng, Nikhil Thorat, Duen Horng Chau, Fernanda B. Viegas, and Martin Wattenberg. 2019\.  GAN Lab: Understanding Complex Deep Generative Models Using Interactive Visual Experimentation.  _IEEE TVCG_ 25 (2019).
  * Krishna et al. (2022) Satyapriya Krishna, Tessa Han, Alex Gu, Javin Pombra, Shahin Jabbari, Steven Wu, and Himabindu Lakkaraju. 2022.  The Disagreement Problem in Explainable Machine Learning: A Practitioner’s Perspective.  _arXiv:2202.01602_ (2022).
  * Lundberg and Lee (2017) Scott M. Lundberg and Su-In Lee. 2017.  A Unified Approach to Interpreting Model Predictions. In _NeurIPS_.
  * Pandit et al. (2007) Shashank Pandit, Duen Horng Chau, Samuel Wang, and Christos Faloutsos. 2007.  Netprobe: A Fast and Scalable System for Fraud Detection in Online Auction Networks. In _Proceedings of the 16th International Conference on World Wide Web_.
  * Qian et al. (2021) Xin Qian, Eunyee Koh, Fan Du, Sungchul Kim, Joel Chan, Ryan A. Rossi, Sana Malik, and Tak Yeon Lee. 2021\.  Generating Accurate Caption Units for Figure Captioning. In _Proceedings of the Web Conference 2021_.
  * Ribeiro et al. (2016) Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. 2016\.  ”Why Should I Trust You?”: Explaining the Predictions of Any Classifier. In _KDD_.
  * Ribeiro et al. (2018) Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. 2018\.  Anchors: High Precision Model-Agnostic Explanations.  (2018).
  * Rudin (2019) Cynthia Rudin. 2019\.  Stop Explaining Black Box Machine Learning Models for High Stakes Decisions and Use Interpretable Models Instead.  _Nature Machine Intelligence_ 1 (2019).
  * Schubert et al. (2020) Ludwig Schubert, Michael Petrov, Shan Carter, Nick Cammarata, Gabriel Goh, and Chris Olah. 2020\.  OpenAI Microscope.  https://microscope.openai.com/
  * Shapley (1953) Lloyd S Shapley. 1953\.  A Value for N-Person Games.  (1953).
  * Smilkov et al. (2019) Daniel Smilkov, Nikhil Thorat, Yannick Assogba, Ann Yuan, Nick Kreeger, Ping Yu, Kangyi Zhang, Shanqing Cai, Eric Nielsen, David Soergel, Stan Bileschi, Michael Terry, Charles Nicholson, Sandeep N. Gupta, Sarah Sirajuddin, D. Sculley, Rajat Monga, Greg Corrado, Fernanda B. Viégas, and Martin Wattenberg. 2019.  TensorFlow.Js: Machine Learning for the Web and Beyond.  _arXiv_ (2019).
  * Tenney et al. (2020) Ian Tenney, James Wexler, Jasmijn Bastings, Tolga Bolukbasi, Andy Coenen, Sebastian Gehrmann, Ellen Jiang, Mahima Pushkarna, Carey Radebaugh, Emily Reif, and Ann Yuan. 2020.  The Language Interpretability Tool: Extensible, Interactive Visualizations and Analysis for NLP Models. In _EMNLP Demo_.
  * UNESCO (2021) UNESCO. 2021.  Recommendation on the Ethics of Artificial Intelligence.  https://unesdoc.unesco.org/ark:/48223/pf0000380455
  * Wang et al. (2022a) Zijie J. Wang, Alex Kale, Harsha Nori, Peter Stella, Mark E. Nunnally, Duen Horng Chau, Mihaela Vorvoreanu, Jennifer Wortman Vaughan, and Rich Caruana. 2022a.  Interpretability, Then What? Editing Machine Learning Models to Reflect Human Knowledge and Values. In _KDD_.
  * Wang et al. (2020) Zijie J. Wang, Robert Turko, Omar Shaikh, Haekyu Park, Nilaksh Das, Fred Hohman, Minsuk Kahng, and Duen Horng Chau. 2020\.  CNN Explainer: Learning Convolutional Neural Networks with Interactive Visualization.  _TVCG_ (2020).
  * Wang et al. (2022b) Zijie J. Wang, Chudi Zhong, Rui Xin, Takuya Takagi, Zhi Chen, Duen Horng Chau, Cynthia Rudin, and Margo Seltzer. 2022b.  TimberTrek: Exploring and Curating Trustworthy Decision Trees with Interactive Visualization. In _VIS_.
  * Wexler et al. (2019) James Wexler, Mahima Pushkarna, Tolga Bolukbasi, Martin Wattenberg, Fernanda Viegas, and Jimbo Wilson. 2019.  The What-If Tool: Interactive Probing of Machine Learning Models.  _IEEE TVCG_ 26 (2019).
  * Wortman Vaughan and Wallach (2022) Jennifer Wortman Vaughan and Hanna Wallach. 2022.  A Human-Centered Agenda for Intelligible Machine Learning. (2022).

##  Appendix A Supplementary Examples

Fig. S1.  In this example, we use WebSHAP to explain how a TinyVGG multi-class
image classifier (Wang et al., 2020) makes predictions. We compute the SHAP
values of 16 image segments and then visualize them using a diverging color
scale overlay. Visualizations show that the model learns to capture the
ladybug’s shape and color. All components—image classifier, image segmenter,
and WebSHAP—run completely in the browser. This example is accessible at
https://poloclub.github.io/webshap/?model=image.

A screenshot of a Web app that uses WebSHAP to explain an image classifier.

Fig. S2.  We use WebSHAP to explain predictions of a transformer-based text
toxicity detector. We compute the SHAP values for individual text tokens and
visualize them using a diverging color scale applied to each token’s
background color. It shows negative words such as “stupid” and “down”
contribute significantly to the toxicity prediction. The tokenizer, toxicity
detector, and WebSHAP run entirely on the client-side. This example is
accessible at https://poloclub.github.io/webshap/?model=text.

A screenshot of a Web app that uses WebSHAP to explain a text toxicity
detector.